summaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2023-07-03 04:24:22 +1000
committerGitHub <noreply@github.com>2023-07-02 19:24:22 +0100
commit7ff80a57cbe57e888646c3b90e2f4f9dea977156 (patch)
tree9917aa79a37e2c51124b63af094da8a96591313c /users
parent9dbad1fa5c068c42f0e948242a2f1922824fbb22 (diff)
Get rid of `USB_LED_SCROLL_LOCK` (#21405)
Diffstat (limited to 'users')
-rw-r--r--users/curry/oled.c10
-rwxr-xr-xusers/ericgebhart/oled/oled_stuff.c13
-rw-r--r--users/spidey3/layer_rgb.c12
-rw-r--r--users/xulkal/custom_oled.c14
-rw-r--r--users/zer09/zer09.c9
5 files changed, 28 insertions, 30 deletions
diff --git a/users/curry/oled.c b/users/curry/oled.c
index 89112af121..2defcbd80e 100644
--- a/users/curry/oled.c
+++ b/users/curry/oled.c
@@ -86,12 +86,12 @@ void render_layer_state(void) {
oled_write_P(PSTR(" Mods"), layer_state_is(_MODS));
}
-void render_keylock_status(uint8_t led_usb_state) {
+void render_keylock_status(led_t led_state) {
oled_write_P(PSTR("Lock:"), false);
oled_write_P(PSTR(" "), false);
- oled_write_P(PSTR("N"), led_usb_state & (1 << USB_LED_NUM_LOCK));
- oled_write_P(PSTR("C"), led_usb_state & (1 << USB_LED_CAPS_LOCK));
- oled_write_ln_P(PSTR("S"), led_usb_state & (1 << USB_LED_SCROLL_LOCK));
+ oled_write_P(PSTR("N"), led_state.num_lock);
+ oled_write_P(PSTR("C"), led_state.caps_lock);
+ oled_write_ln_P(PSTR("S"), led_state.scroll_lock);
}
void render_mod_status(uint8_t modifiers) {
@@ -129,7 +129,7 @@ void render_user_status(void) {
void render_status_main(void) {
/* Show Keyboard Layout */
render_default_layer_state();
- render_keylock_status(host_keyboard_leds());
+ render_keylock_status(host_keyboard_led_state());
render_bootmagic_status();
render_user_status();
diff --git a/users/ericgebhart/oled/oled_stuff.c b/users/ericgebhart/oled/oled_stuff.c
index f2c4f0f394..211fe4ab3e 100755
--- a/users/ericgebhart/oled/oled_stuff.c
+++ b/users/ericgebhart/oled/oled_stuff.c
@@ -32,11 +32,11 @@ void oled_render_locale(void) {
}
}
-void oled_render_keylock_status(uint8_t led_usb_state) {
+void oled_render_keylock_status(led_t led_state) {
oled_write_P(PSTR(" Lock:"), false);
- oled_write_P(PSTR("N"), led_usb_state & (1 << USB_LED_NUM_LOCK));
- oled_write_P(PSTR("C"), led_usb_state & (1 << USB_LED_CAPS_LOCK));
- oled_write_P(PSTR("S"), led_usb_state & (1 << USB_LED_SCROLL_LOCK));
+ oled_write_P(PSTR("N"), led_state.num_lock);
+ oled_write_P(PSTR("C"), led_state.caps_lock);
+ oled_write_P(PSTR("S"), led_state.scroll_lock);
}
void oled_render_mod_status(uint8_t modifiers) {
@@ -49,7 +49,7 @@ void oled_render_mod_status(uint8_t modifiers) {
void oled_render_mod_lock_status(void){
oled_render_mod_status(get_mods() | get_oneshot_mods());
- oled_render_keylock_status(host_keyboard_leds());
+ oled_render_keylock_status(host_keyboard_led_state());
}
@@ -187,6 +187,3 @@ bool oled_task_user(void) {
}
#endif
-
-/* oled_render_keylock_status(host_keyboard_leds()); */
-/* oled_render_mod_status(get_mods() | get_oneshot_mods()); */
diff --git a/users/spidey3/layer_rgb.c b/users/spidey3/layer_rgb.c
index cff20898cd..be76788d21 100644
--- a/users/spidey3/layer_rgb.c
+++ b/users/spidey3/layer_rgb.c
@@ -73,9 +73,9 @@ const rgblight_segment_t *const PROGMEM _rgb_layers[] = {
[LAYER_OFFSET + _NUMPAD] = _layer1_layer,
[LAYER_OFFSET + _FN] = _layer2_layer,
- [LOCK_OFFSET + USB_LED_NUM_LOCK] = _numlock_layer,
- [LOCK_OFFSET + USB_LED_CAPS_LOCK] = _capslock_layer,
- [LOCK_OFFSET + USB_LED_SCROLL_LOCK] = _scrolllock_layer,
+ [LOCK_OFFSET + 0] = _numlock_layer,
+ [LOCK_OFFSET + 1] = _capslock_layer,
+ [LOCK_OFFSET + 2] = _scrolllock_layer,
[MISC_OFFSET + 0] = _gflock_layer,
[MISC_OFFSET + 1] = _glyphreplace_layer,
@@ -374,9 +374,9 @@ layer_state_t layer_state_set_user_rgb(layer_state_t state) {
}
bool led_update_user_rgb(led_t led_state) {
- rgblight_set_layer_state(LOCK_OFFSET + USB_LED_NUM_LOCK, led_state.num_lock);
- rgblight_set_layer_state(LOCK_OFFSET + USB_LED_CAPS_LOCK, led_state.caps_lock);
- rgblight_set_layer_state(LOCK_OFFSET + USB_LED_SCROLL_LOCK, led_state.scroll_lock);
+ rgblight_set_layer_state(LOCK_OFFSET + 0, led_state.num_lock);
+ rgblight_set_layer_state(LOCK_OFFSET + 1, led_state.caps_lock);
+ rgblight_set_layer_state(LOCK_OFFSET + 2, led_state.scroll_lock);
return true;
}
diff --git a/users/xulkal/custom_oled.c b/users/xulkal/custom_oled.c
index fd03033ad6..c6341fa3d7 100644
--- a/users/xulkal/custom_oled.c
+++ b/users/xulkal/custom_oled.c
@@ -71,15 +71,15 @@ static void render_layer(void)
static void render_keyboard_leds(void)
{
// Host Keyboard LED Status
- uint8_t led_state = host_keyboard_leds();
+ led_t led_state = host_keyboard_led_state();
#ifdef OLED_90ROTATION
- oled_write_P(IS_LED_ON(led_state, USB_LED_NUM_LOCK) ? PSTR("NUMLK") : PSTR(" "), false);
- oled_write_P(IS_LED_ON(led_state, USB_LED_CAPS_LOCK) ? PSTR("CAPLK") : PSTR(" "), false);
- oled_write_P(IS_LED_ON(led_state, USB_LED_SCROLL_LOCK) ? PSTR("SCRLK") : PSTR(" "), false);
+ oled_write_P(led_state.num_lock ? PSTR("NUMLK") : PSTR(" "), false);
+ oled_write_P(led_state.caps_lock ? PSTR("CAPLK") : PSTR(" "), false);
+ oled_write_P(led_state.scroll_lock ? PSTR("SCRLK") : PSTR(" "), false);
#else
- oled_write_P(IS_LED_ON(led_state, USB_LED_NUM_LOCK) ? PSTR("NUM ") : PSTR(" "), false);
- oled_write_P(IS_LED_ON(led_state, USB_LED_CAPS_LOCK) ? PSTR("CAPS ") : PSTR(" "), false);
- oled_write_P(IS_LED_ON(led_state, USB_LED_SCROLL_LOCK) ? PSTR("SCRL") : PSTR(" "), false);
+ oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
+ oled_write_P(led_state.caps_lock ? PSTR("CAPS ") : PSTR(" "), false);
+ oled_write_P(led_state.scroll_lock ? PSTR("SCRL") : PSTR(" "), false);
#endif
}
diff --git a/users/zer09/zer09.c b/users/zer09/zer09.c
index 78433b4c20..5e192f037a 100644
--- a/users/zer09/zer09.c
+++ b/users/zer09/zer09.c
@@ -69,8 +69,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return process_record_keymap(keycode, record);
}
-void led_set_user(uint8_t usb_led) {
- if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
+bool led_update_user(led_t led_state) {
+ if (led_state.caps_lock) {
rbw_led_keys[RBW_LCAP].status = ENABLED;
rbw_led_keys[RBW_RCAP].status = ENABLED;
} else {
@@ -78,11 +78,12 @@ void led_set_user(uint8_t usb_led) {
rbw_led_keys[RBW_RCAP].status = DISABLED;
}
- if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
+ if (led_state.scroll_lock) {
rbw_led_keys[RBW_SCRL].status = ENABLED;
} else {
rbw_led_keys[RBW_SCRL].status = DISABLED;
}
- led_set_keymap(usb_led);
+ led_set_keymap(led_state.raw);
+ return false;
}