aboutsummaryrefslogtreecommitdiffstats
path: root/keyboard/atomic
diff options
context:
space:
mode:
authorGravatar IBNobody <ibnobody@gmail.com>2016-04-17 22:08:05 -0500
committerGravatar IBNobody <ibnobody@gmail.com>2016-04-17 22:08:05 -0500
commitef73ab662812232f5e73c8098a059439dcb201fa (patch)
treed3b0f885d05a62d1d576e1bdb760db6729fd09ff /keyboard/atomic
parent5c98ad59606ee95b82c27bf2525383a9ec88542b (diff)
downloadqmk_firmware-ef73ab662812232f5e73c8098a059439dcb201fa.tar.gz
Notes Bugfix
Diffstat (limited to 'keyboard/atomic')
-rw-r--r--keyboard/atomic/keymaps/pvc/keymap.c65
1 files changed, 29 insertions, 36 deletions
diff --git a/keyboard/atomic/keymaps/pvc/keymap.c b/keyboard/atomic/keymaps/pvc/keymap.c
index 563519e4c..f88d5117c 100644
--- a/keyboard/atomic/keymaps/pvc/keymap.c
+++ b/keyboard/atomic/keymaps/pvc/keymap.c
@@ -302,45 +302,38 @@ void matrix_init_user(void)
void led_set_user(uint8_t usb_led)
{
static uint8_t old_usb_led = 0;
- static bool first_run = true;
- // Skip first execution to avoid beeps caused by LED states being detected on power-up
- if (!first_run)
+ if ((usb_led & (1<<USB_LED_CAPS_LOCK)) && !(old_usb_led & (1<<USB_LED_CAPS_LOCK)))
{
-
- if ((usb_led & (1<<USB_LED_CAPS_LOCK)) && !(old_usb_led & (1<<USB_LED_CAPS_LOCK)))
- {
- // If CAPS LK LED is turning on...
- PLAY_NOTE_ARRAY(tone_caps_on, false, LEGATO);
- }
- else if (!(usb_led & (1<<USB_LED_CAPS_LOCK)) && (old_usb_led & (1<<USB_LED_CAPS_LOCK)))
- {
- // If CAPS LK LED is turning off...
- PLAY_NOTE_ARRAY(tone_caps_off, false, LEGATO);
- }
- else if ((usb_led & (1<<USB_LED_NUM_LOCK)) && !(old_usb_led & (1<<USB_LED_NUM_LOCK)))
- {
- // If NUM LK LED is turning on...
- PLAY_NOTE_ARRAY(tone_numlk_on, false, LEGATO);
- }
- else if (!(usb_led & (1<<USB_LED_NUM_LOCK)) && (old_usb_led & (1<<USB_LED_NUM_LOCK)))
- {
- // If NUM LED is turning off...
- PLAY_NOTE_ARRAY(tone_numlk_off, false, LEGATO);
- }
- else if ((usb_led & (1<<USB_LED_SCROLL_LOCK)) && !(old_usb_led & (1<<USB_LED_SCROLL_LOCK)))
- {
- // If SCROLL LK LED is turning on...
- PLAY_NOTE_ARRAY(tone_scroll_on, false, LEGATO);
- }
- else if (!(usb_led & (1<<USB_LED_SCROLL_LOCK)) && (old_usb_led & (1<<USB_LED_SCROLL_LOCK)))
- {
- // If SCROLL LED is turning off...
- PLAY_NOTE_ARRAY(tone_scroll_off, false, LEGATO);
- }
- }
+ // If CAPS LK LED is turning on...
+ PLAY_NOTE_ARRAY(tone_caps_on, false, LEGATO);
+ }
+ else if (!(usb_led & (1<<USB_LED_CAPS_LOCK)) && (old_usb_led & (1<<USB_LED_CAPS_LOCK)))
+ {
+ // If CAPS LK LED is turning off...
+ PLAY_NOTE_ARRAY(tone_caps_off, false, LEGATO);
+ }
+ else if ((usb_led & (1<<USB_LED_NUM_LOCK)) && !(old_usb_led & (1<<USB_LED_NUM_LOCK)))
+ {
+ // If NUM LK LED is turning on...
+ PLAY_NOTE_ARRAY(tone_numlk_on, false, LEGATO);
+ }
+ else if (!(usb_led & (1<<USB_LED_NUM_LOCK)) && (old_usb_led & (1<<USB_LED_NUM_LOCK)))
+ {
+ // If NUM LED is turning off...
+ PLAY_NOTE_ARRAY(tone_numlk_off, false, LEGATO);
+ }
+ else if ((usb_led & (1<<USB_LED_SCROLL_LOCK)) && !(old_usb_led & (1<<USB_LED_SCROLL_LOCK)))
+ {
+ // If SCROLL LK LED is turning on...
+ PLAY_NOTE_ARRAY(tone_scroll_on, false, LEGATO);
+ }
+ else if (!(usb_led & (1<<USB_LED_SCROLL_LOCK)) && (old_usb_led & (1<<USB_LED_SCROLL_LOCK)))
+ {
+ // If SCROLL LED is turning off...
+ PLAY_NOTE_ARRAY(tone_scroll_off, false, LEGATO);
+ }
old_usb_led = usb_led;
- first_run = false;
}