From 9ab16e62f75dc6228549ec0aba00ec0704bbc779 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 3 Jul 2023 04:35:41 +1000 Subject: Get rid of `USB_LED_NUM_LOCK` (#21424) --- .../40percentclub/gherkin/keymaps/default/keymap.c | 7 +-- keyboards/contra/keymaps/maxr1998/keymap.c | 5 ++- keyboards/crkbd/keymaps/rpbaptist/keymap.c | 6 +-- .../dztech/dz60rgb/keymaps/matthewrobo/keymap.c | 13 ++---- keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c | 25 ++--------- .../dztech/dz65rgb/keymaps/matthewrobo/keymap.c | 11 +---- .../handwired/arrow_pad/keymaps/default/keymap.c | 7 +-- .../handwired/arrow_pad/keymaps/pad_21/keymap.c | 7 +-- .../handwired/arrow_pad/keymaps/pad_24/keymap.c | 7 +-- keyboards/input_club/infinity60/led.c | 52 ++++++++++++---------- keyboards/input_club/infinity60/led_controller.c | 5 ++- keyboards/kbdfans/niu_mini/keymaps/tobias/keymap.c | 12 ++--- .../kprepublic/jj40/keymaps/stevexyz/keymap.c | 5 +-- .../massdrop/alt/keymaps/jdelkins_ss/keymap.c | 3 +- keyboards/mt/mt980/keymaps/walker/keymap.c | 4 +- .../novelkeys/novelpad/keymaps/0xdec/keymap.c | 5 ++- .../setta21/keymaps/salicylic/keymap.c | 6 +-- .../westfoxtrot/cypher/rev1/keymaps/kwer/keymap.c | 19 ++------ keyboards/xiudi/xd75/keymaps/billypython/keymap.c | 2 +- keyboards/xiudi/xd75/keymaps/boy_314/keymap.c | 7 +-- keyboards/yosino58/keymaps/default/keymap.c | 5 ++- keyboards/yosino58/keymaps/sakura/keymap.c | 5 ++- 22 files changed, 88 insertions(+), 130 deletions(-) (limited to 'keyboards') diff --git a/keyboards/40percentclub/gherkin/keymaps/default/keymap.c b/keyboards/40percentclub/gherkin/keymaps/default/keymap.c index ab2a1fa1c1..f4d3032857 100644 --- a/keyboards/40percentclub/gherkin/keymaps/default/keymap.c +++ b/keyboards/40percentclub/gherkin/keymaps/default/keymap.c @@ -59,16 +59,17 @@ void keyboard_pre_init_user(void) { setPinOutput(B0); } -void led_set_user(uint8_t usb_led) { - if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { +bool led_update_user(led_t led_state) { + if (led_state.num_lock) { writePinLow(D5); } else { writePinHigh(D5); } - if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + if (led_state.caps_lock) { writePinLow(B0); } else { writePinHigh(B0); } + return false; } diff --git a/keyboards/contra/keymaps/maxr1998/keymap.c b/keyboards/contra/keymaps/maxr1998/keymap.c index 8a56c60746..0802a211f0 100644 --- a/keyboards/contra/keymaps/maxr1998/keymap.c +++ b/keyboards/contra/keymaps/maxr1998/keymap.c @@ -176,10 +176,11 @@ void update_tri_layer_user(void) { } } -void led_set_user(uint8_t usb_led) { +bool led_update_user(led_t led_state) { // Force-enable Numlock - if (!(usb_led & (1<. * both regular threads and ISRs, unlocked (during resume-from-sleep). * In particular, I2C functions (interrupt-driven) should NOT be called from here. */ -void led_set(uint8_t usb_led) { - msg_t msg; - - if (usb_led & (1<event.pressed) { layer_invert(L_NUMPAD); - bool num_lock = host_keyboard_leds() & 1<