summary refs log tree commit diff
path: root/quantum
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 /quantum
parent9dbad1fa5c068c42f0e948242a2f1922824fbb22 (diff)
Get rid of `USB_LED_SCROLL_LOCK` (#21405)
Diffstat (limited to 'quantum')
-rw-r--r--quantum/action.c12
-rw-r--r--quantum/led.h1
2 files changed, 6 insertions, 7 deletions
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 <http://www.gnu.org/licenses/>.
 /* keyboard LEDs */
 #define USB_LED_NUM_LOCK 0
 #define USB_LED_CAPS_LOCK 1
-#define USB_LED_SCROLL_LOCK 2
 
 #ifdef __cplusplus
 extern "C" {