diff options
author | Ryan <fauxpark@gmail.com> | 2023-07-06 18:48:02 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-06 09:48:02 +0100 |
commit | 87b11345a55d076966846d87b60d0f315b8bb984 (patch) | |
tree | a64503358d5f30b55a722b882eebaf1b60b03e1f /keyboards/planck/keymaps/hieax/common | |
parent | 928e03e8d669cb35a96c2aa4a09012c527b27892 (diff) |
Get rid of `USB_LED_CAPS_LOCK` (#21436)
Diffstat (limited to 'keyboards/planck/keymaps/hieax/common')
-rw-r--r-- | keyboards/planck/keymaps/hieax/common/init.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/keyboards/planck/keymaps/hieax/common/init.h b/keyboards/planck/keymaps/hieax/common/init.h index 6366a19f65..6d0b4392fb 100644 --- a/keyboards/planck/keymaps/hieax/common/init.h +++ b/keyboards/planck/keymaps/hieax/common/init.h @@ -13,21 +13,22 @@ void matrix_init_user(void) #ifdef AUDIO_ENABLE #ifdef BACKLIGHT_ENABLE -void led_set_user(uint8_t usb_led) +bool led_update_user(led_t led_state) { - static uint8_t old_usb_led = 0; + static led_t old_led_state = {0}; _delay_ms(10); // gets rid of tick if (!is_playing_notes()) { - if ((usb_led & (1<<USB_LED_CAPS_LOCK)) && !(old_usb_led & (1<<USB_LED_CAPS_LOCK))) { + if (led_state.caps_lock && !old_led_state.caps_lock) { // if capslock LED is turning on PLAY_SONG(song_caps_on); } - else if (!(usb_led & (1<<USB_LED_CAPS_LOCK)) && (old_usb_led & (1<<USB_LED_CAPS_LOCK))) { + else if (!led_state.caps_lock && old_led_state.caps_lock) { // if capslock LED is turning off PLAY_SONG(song_caps_off); } } - old_usb_led = usb_led; + old_led_state = led_state; + return false; } #endif |