From 7ff80a57cbe57e888646c3b90e2f4f9dea977156 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 3 Jul 2023 04:24:22 +1000 Subject: Get rid of `USB_LED_SCROLL_LOCK` (#21405) --- quantum/action.c | 12 ++++++------ quantum/led.h | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'quantum') diff --git a/quantum/action.c b/quantum/action.c index a45e70c557..84ecf6da9a 100644 --- a/quantum/action.c +++ b/quantum/action.c @@ -882,7 +882,7 @@ __attribute__((weak)) void register_code(uint8_t code) { } else if (KC_LOCKING_CAPS_LOCK == code) { # ifdef LOCKING_RESYNC_ENABLE // Resync: ignore if caps lock already is on - if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) return; + if (host_keyboard_led_state().caps_lock) return; # endif add_key(KC_CAPS_LOCK); send_keyboard_report(); @@ -892,7 +892,7 @@ __attribute__((weak)) void register_code(uint8_t code) { } else if (KC_LOCKING_NUM_LOCK == code) { # ifdef LOCKING_RESYNC_ENABLE - if (host_keyboard_leds() & (1 << USB_LED_NUM_LOCK)) return; + if (host_keyboard_led_state().num_lock) return; # endif add_key(KC_NUM_LOCK); send_keyboard_report(); @@ -902,7 +902,7 @@ __attribute__((weak)) void register_code(uint8_t code) { } else if (KC_LOCKING_SCROLL_LOCK == code) { # ifdef LOCKING_RESYNC_ENABLE - if (host_keyboard_leds() & (1 << USB_LED_SCROLL_LOCK)) return; + if (host_keyboard_led_state().scroll_lock) return; # endif add_key(KC_SCROLL_LOCK); send_keyboard_report(); @@ -952,7 +952,7 @@ __attribute__((weak)) void unregister_code(uint8_t code) { } else if (KC_LOCKING_CAPS_LOCK == code) { # ifdef LOCKING_RESYNC_ENABLE // Resync: ignore if caps lock already is off - if (!(host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK))) return; + if (!host_keyboard_led_state().caps_lock) return; # endif add_key(KC_CAPS_LOCK); send_keyboard_report(); @@ -961,7 +961,7 @@ __attribute__((weak)) void unregister_code(uint8_t code) { } else if (KC_LOCKING_NUM_LOCK == code) { # ifdef LOCKING_RESYNC_ENABLE - if (!(host_keyboard_leds() & (1 << USB_LED_NUM_LOCK))) return; + if (!host_keyboard_led_state().num_lock) return; # endif add_key(KC_NUM_LOCK); send_keyboard_report(); @@ -970,7 +970,7 @@ __attribute__((weak)) void unregister_code(uint8_t code) { } else if (KC_LOCKING_SCROLL_LOCK == code) { # ifdef LOCKING_RESYNC_ENABLE - if (!(host_keyboard_leds() & (1 << USB_LED_SCROLL_LOCK))) return; + if (!host_keyboard_led_state().scroll_lock) return; # endif add_key(KC_SCROLL_LOCK); send_keyboard_report(); diff --git a/quantum/led.h b/quantum/led.h index d9a132bbaa..197f2618be 100644 --- a/quantum/led.h +++ b/quantum/led.h @@ -25,7 +25,6 @@ along with this program. If not, see . /* keyboard LEDs */ #define USB_LED_NUM_LOCK 0 #define USB_LED_CAPS_LOCK 1 -#define USB_LED_SCROLL_LOCK 2 #ifdef __cplusplus extern "C" { -- cgit v1.2.3