summaryrefslogtreecommitdiffstats
path: root/keyboards/planck/keymaps
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/planck/keymaps
parent9dbad1fa5c068c42f0e948242a2f1922824fbb22 (diff)
Get rid of `USB_LED_SCROLL_LOCK` (#21405)
Diffstat (limited to 'keyboards/planck/keymaps')
-rw-r--r--keyboards/planck/keymaps/vaire/keymap.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/keyboards/planck/keymaps/vaire/keymap.c b/keyboards/planck/keymaps/vaire/keymap.c
index 05f7f4a520..f58486cda8 100644
--- a/keyboards/planck/keymaps/vaire/keymap.c
+++ b/keyboards/planck/keymaps/vaire/keymap.c
@@ -80,47 +80,48 @@ void matrix_init_user(void)
println("Matrix Init");
}
-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 CAPS LK LED is turning on...
PLAY_SONG(tone_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 CAPS LK LED is turning off...
PLAY_SONG(tone_caps_off);
}
- else if ((usb_led & (1<<USB_LED_NUM_LOCK)) && !(old_usb_led & (1<<USB_LED_NUM_LOCK)))
+ else if (led_state.num_lock && !old_led_state.num_lock)
{
// If NUM LK LED is turning on...
PLAY_SONG(tone_numlk_on);
}
- else if (!(usb_led & (1<<USB_LED_NUM_LOCK)) && (old_usb_led & (1<<USB_LED_NUM_LOCK)))
+ else if (!led_state.num_lock && old_led_state.num_lock)
{
// If NUM LED is turning off...
PLAY_SONG(tone_numlk_off);
}
- else if ((usb_led & (1<<USB_LED_SCROLL_LOCK)) && !(old_usb_led & (1<<USB_LED_SCROLL_LOCK)))
+ else if (led_state.scroll_lock && !old_led_state.scroll_lock)
{
// If SCROLL LK LED is turning on...
PLAY_SONG(tone_scroll_on);
}
- else if (!(usb_led & (1<<USB_LED_SCROLL_LOCK)) && (old_usb_led & (1<<USB_LED_SCROLL_LOCK)))
+ else if (!led_state.scroll_lock && old_led_state.scroll_lock)
{
// If SCROLL LED is turning off...
PLAY_SONG(tone_scroll_off);
}
}
- old_usb_led = usb_led;
+ old_led_state = led_state;
+ return false;
}