summaryrefslogtreecommitdiff
path: root/keyboards/gmmk/pro/rev1/ansi
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2023-02-06 13:36:09 +1100
committerGitHub <noreply@github.com>2023-02-06 02:36:09 +0000
commitf0618a1d53a50a6ed6a6b050daf31365599bef4b (patch)
tree45ffe5bc929f0815b81816fd648f1a90cfbe5356 /keyboards/gmmk/pro/rev1/ansi
parentd5e622b979c54ddc8f9ad97116c302e29c6aed12 (diff)
Remove `IS_HOST_LED_ON` and migrate usages (#19753)
Diffstat (limited to 'keyboards/gmmk/pro/rev1/ansi')
-rw-r--r--keyboards/gmmk/pro/rev1/ansi/keymaps/byungyoonc/keymap.c5
-rw-r--r--keyboards/gmmk/pro/rev1/ansi/keymaps/gourdo1/keymap.c18
-rw-r--r--keyboards/gmmk/pro/rev1/ansi/keymaps/jonavin/keymap.c9
-rw-r--r--keyboards/gmmk/pro/rev1/ansi/keymaps/lalitmaganti/keymap.c2
-rw-r--r--keyboards/gmmk/pro/rev1/ansi/keymaps/paddlegame/keymap.c6
5 files changed, 23 insertions, 17 deletions
diff --git a/keyboards/gmmk/pro/rev1/ansi/keymaps/byungyoonc/keymap.c b/keyboards/gmmk/pro/rev1/ansi/keymaps/byungyoonc/keymap.c
index b54f7f404c..487e6dc04e 100644
--- a/keyboards/gmmk/pro/rev1/ansi/keymaps/byungyoonc/keymap.c
+++ b/keyboards/gmmk/pro/rev1/ansi/keymaps/byungyoonc/keymap.c
@@ -112,10 +112,11 @@ static void set_rgb_wlck_leds(void) {
}
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
- if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) {
+ led_t led_state = host_keyboard_led_state();
+ if (led_state.caps_lock) {
set_rgb_caps_leds();
}
- if (!IS_HOST_LED_ON(USB_LED_NUM_LOCK)) {
+ if (!led_state.num_lock) {
set_rgb_nlck_notset_leds();
}
if (keymap_config.no_gui) {
diff --git a/keyboards/gmmk/pro/rev1/ansi/keymaps/gourdo1/keymap.c b/keyboards/gmmk/pro/rev1/ansi/keymaps/gourdo1/keymap.c
index 800fe02d7d..64954feeaf 100644
--- a/keyboards/gmmk/pro/rev1/ansi/keymaps/gourdo1/keymap.c
+++ b/keyboards/gmmk/pro/rev1/ansi/keymaps/gourdo1/keymap.c
@@ -245,8 +245,10 @@ void hurt_paddle(void) {
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
if (get_rgb_nightmode()) rgb_matrix_set_color_all(RGB_OFF);
+ led_t led_state = host_keyboard_led_state();
+
// Scroll Lock RGB setup
- if (IS_HOST_LED_ON(USB_LED_SCROLL_LOCK)) {
+ if (led_state.scroll_lock) {
rgb_matrix_set_color(LED_L3, RGB_RED);
rgb_matrix_set_color(LED_L4, RGB_RED);
rgb_matrix_set_color(LED_TAB, RGB_RED);
@@ -256,7 +258,7 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
/*
// System NumLock warning indicator RGB setup
#ifdef INVERT_NUMLOCK_INDICATOR
- if (!IS_HOST_LED_ON(USB_LED_NUM_LOCK)) { // on if NUM lock is OFF to bring attention to overlay numpad not functional when enabled
+ if (!led_state.num_lock) { // on if NUM lock is OFF to bring attention to overlay numpad not functional when enabled
rgb_matrix_set_color(LED_GRV, RGB_ORANGE2);
rgb_matrix_set_color(LED_L1, RGB_ORANGE2);
rgb_matrix_set_color(LED_L2, RGB_ORANGE2);
@@ -264,7 +266,7 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
rgb_matrix_set_color(LED_FN, RGB_ORANGE2);
}
#else
- if (IS_HOST_LED_ON(USB_LED_NUM_LOCK)) { // Normal, on if NUM lock is ON
+ if (led_state.num_lock) { // Normal, on if NUM lock is ON
rgb_matrix_set_color(LED_GRV, RGB_ORANGE2);
rgb_matrix_set_color(LED_L1, RGB_ORANGE2);
rgb_matrix_set_color(LED_L2, RGB_ORANGE2);
@@ -275,7 +277,7 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
*/
// CapsLock RGB setup
- if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) {
+ if (led_state.caps_lock) {
if (user_config.rgb_hilite_caps) {
for (uint8_t i = 0; i < ARRAYSIZE(LED_LIST_LETTERS); i++) {
rgb_matrix_set_color(LED_LIST_LETTERS[i], RGB_CHARTREUSE);
@@ -360,11 +362,11 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
// System NumLock warning indicator RGB setup
#ifdef INVERT_NUMLOCK_INDICATOR
- if (!IS_HOST_LED_ON(USB_LED_NUM_LOCK)) { // on if NUM lock is OFF to bring attention to overlay numpad not functional when enabled
+ if (!led_state.num_lock) { // on if NUM lock is OFF to bring attention to overlay numpad not functional when enabled
rgb_matrix_set_color(LED_N, RGB_ORANGE2);
}
#else
- if (IS_HOST_LED_ON(USB_LED_NUM_LOCK)) { // Normal, on if NUM lock is ON
+ if (led_state.num_lock) { // Normal, on if NUM lock is ON
rgb_matrix_set_color(LED_N, RGB_ORANGE2);
}
#endif // INVERT_NUMLOCK_INDICATOR
@@ -432,11 +434,11 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
// Numpad & Mouse Keys overlay RGB
case _NUMPADMOUSE:
#ifdef INVERT_NUMLOCK_INDICATOR
- if (!IS_HOST_LED_ON(USB_LED_NUM_LOCK)) { // on if NUM lock is OFF to bring attention to overlay numpad not functional when enabled
+ if (!led_state.num_lock) { // on if NUM lock is OFF to bring attention to overlay numpad not functional when enabled
rgb_matrix_set_color(LED_N, RGB_ORANGE2);
}
#else
- if (IS_HOST_LED_ON(USB_LED_NUM_LOCK)) { // Normal, on if NUM lock is ON
+ if (led_state.num_lock) { // Normal, on if NUM lock is ON
rgb_matrix_set_color(LED_N, RGB_ORANGE2);
}
#endif // INVERT_NUMLOCK_INDICATOR
diff --git a/keyboards/gmmk/pro/rev1/ansi/keymaps/jonavin/keymap.c b/keyboards/gmmk/pro/rev1/ansi/keymaps/jonavin/keymap.c
index 4c87822b8a..7cb2d9f6fe 100644
--- a/keyboards/gmmk/pro/rev1/ansi/keymaps/jonavin/keymap.c
+++ b/keyboards/gmmk/pro/rev1/ansi/keymaps/jonavin/keymap.c
@@ -120,25 +120,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
#ifdef RGB_MATRIX_ENABLE
// Capslock, Scroll lock and Numlock indicator on Left side lights.
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
+ led_t led_state = host_keyboard_led_state();
if (get_rgb_nightmode()) rgb_matrix_set_color_all(RGB_OFF);
- if (IS_HOST_LED_ON(USB_LED_SCROLL_LOCK)) {
+ if (led_state.scroll_lock) {
rgb_matrix_set_color(LED_L1, RGB_GREEN);
rgb_matrix_set_color(LED_L2, RGB_GREEN);
}
#ifdef INVERT_NUMLOCK_INDICATOR
- if (!IS_HOST_LED_ON(USB_LED_NUM_LOCK)) { // on if NUM lock is OFF
+ if (!led_state.num_lock) { // on if NUM lock is OFF
rgb_matrix_set_color(LED_L3, RGB_MAGENTA);
rgb_matrix_set_color(LED_L4, RGB_MAGENTA);
}
#else
- if (IS_HOST_LED_ON(USB_LED_NUM_LOCK)) { // Normal, on if NUM lock is ON
+ if (led_state.num_lock) { // Normal, on if NUM lock is ON
rgb_matrix_set_color(LED_L3, RGB_MAGENTA);
rgb_matrix_set_color(LED_L4, RGB_MAGENTA);
}
#endif // INVERT_NUMLOCK_INDICATOR
- if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) {
+ if (led_state.caps_lock) {
rgb_matrix_set_color(LED_L5, RGB_RED);
rgb_matrix_set_color(LED_L6, RGB_RED);
rgb_matrix_set_color(LED_L7, RGB_RED);
diff --git a/keyboards/gmmk/pro/rev1/ansi/keymaps/lalitmaganti/keymap.c b/keyboards/gmmk/pro/rev1/ansi/keymaps/lalitmaganti/keymap.c
index 83ef8c765a..7ec0e8c4b6 100644
--- a/keyboards/gmmk/pro/rev1/ansi/keymaps/lalitmaganti/keymap.c
+++ b/keyboards/gmmk/pro/rev1/ansi/keymaps/lalitmaganti/keymap.c
@@ -82,7 +82,7 @@ static void set_rgb_side_leds(void) {
bool rgb_matrix_indicators_user(void) {
rgb_matrix_set_color_all(0x0, 0x0, 0x0);
- if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) {
+ if (host_keyboard_led_state().caps_lock) {
rgb_matrix_set_color(3, RGB_WHITE); // CAPS
}
set_rgb_side_leds();
diff --git a/keyboards/gmmk/pro/rev1/ansi/keymaps/paddlegame/keymap.c b/keyboards/gmmk/pro/rev1/ansi/keymaps/paddlegame/keymap.c
index c1815a2e28..f4184525fc 100644
--- a/keyboards/gmmk/pro/rev1/ansi/keymaps/paddlegame/keymap.c
+++ b/keyboards/gmmk/pro/rev1/ansi/keymaps/paddlegame/keymap.c
@@ -427,7 +427,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
break;
}
- if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) {
+ led_t led_state = host_keyboard_led_state();
+
+ if (led_state.caps_lock) {
if (!caps_active) {
caps_active = true;
caps_flash_on = true;
@@ -453,7 +455,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
} else {
caps_active = false;
}
- if (IS_HOST_LED_ON(USB_LED_SCROLL_LOCK)) {
+ if (led_state.scroll_lock) {
rgb_matrix_set_color(LED_F10, RGB_WHITE);
}
if (keymap_config.no_gui) {