summaryrefslogtreecommitdiffstats
path: root/keyboards/ergodox_ez
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 /keyboards/ergodox_ez
parent9dbad1fa5c068c42f0e948242a2f1922824fbb22 (diff)
Get rid of `USB_LED_SCROLL_LOCK` (#21405)
Diffstat (limited to 'keyboards/ergodox_ez')
-rwxr-xr-xkeyboards/ergodox_ez/keymaps/bepo_tm_style/keymap.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/keyboards/ergodox_ez/keymaps/bepo_tm_style/keymap.c b/keyboards/ergodox_ez/keymaps/bepo_tm_style/keymap.c
index 45a101ec81..99d10e9a12 100755
--- a/keyboards/ergodox_ez/keymaps/bepo_tm_style/keymap.c
+++ b/keyboards/ergodox_ez/keymaps/bepo_tm_style/keymap.c
@@ -253,12 +253,7 @@ void matrix_scan_user(void) {
};
// The state of the LEDs requested by the system, as a bitmask.
-static uint8_t sys_led_state = 0;
-
-// Use these masks to read the system LEDs state.
-static const uint8_t sys_led_mask_num_lock = 1 << USB_LED_NUM_LOCK;
-static const uint8_t sys_led_mask_caps_lock = 1 << USB_LED_CAPS_LOCK;
-static const uint8_t sys_led_mask_scroll_lock = 1 << USB_LED_SCROLL_LOCK;
+static led_t sys_led_state = {0};
// Value to use to switch LEDs on. The default value of 255 is far too bright.
static const uint8_t max_led_value = 20;
@@ -294,25 +289,26 @@ void led_3_off(void) {
}
// Called when the computer wants to change the state of the keyboard LEDs.
-void led_set_user(uint8_t usb_led) {
- sys_led_state = usb_led;
+bool led_update_user(led_t led_state) {
+ sys_led_state = led_state;
if (LAYER_ON(SYSLEDS)) {
- if (sys_led_state & sys_led_mask_caps_lock) {
+ if (sys_led_state.caps_lock) {
led_1_on();
} else {
led_1_off();
}
- if (sys_led_state & sys_led_mask_num_lock) {
+ if (sys_led_state.num_lock) {
led_2_on();
} else {
led_2_off();
}
- if (sys_led_state & sys_led_mask_scroll_lock) {
+ if (sys_led_state.scroll_lock) {
led_3_on();
} else {
led_3_off();
}
}
+ return false;
}
layer_state_t layer_state_set_user(layer_state_t state) {
@@ -327,7 +323,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
}
if (LAYER_ON(SYSLEDS)) {
- led_set_user(sys_led_state);
+ led_update_user(sys_led_state);
return state;
}