X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=tmk_core%2Fcommon%2Fcommand.c;h=e08f91e51376ebd0fe26cd67716acce2b5ae2381;hb=5b9da20efa837973ed4e9cde49b173bcd05e6ce6;hp=6920970020cc3f0a8ec72e645940b39132074362;hpb=b1b30f167587349acbb7dc4f286a8742b8b63d00;p=max%2Ftmk_keyboard.git diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c index 69209700..e08f91e5 100644 --- a/tmk_core/common/command.c +++ b/tmk_core/common/command.c @@ -57,9 +57,10 @@ static void command_console_help(void); #ifdef MOUSEKEY_ENABLE static bool mousekey_console(uint8_t code); static void mousekey_console_help(void); +static uint8_t numkey2num(uint8_t code); #endif -static uint8_t numkey2num(uint8_t code); + static void switch_default_layer(uint8_t layer); @@ -182,14 +183,22 @@ static bool command_common(uint8_t code) { #ifdef KEYBOARD_LOCK_ENABLE static host_driver_t *host_driver = 0; +#endif +#ifdef SLEEP_LED_ENABLE + static bool sleep_led_test = false; #endif switch (code) { #ifdef SLEEP_LED_ENABLE case KC_Z: // test breathing sleep LED print("Sleep LED test\n"); - sleep_led_toggle(); - led_set(host_keyboard_leds()); + if (sleep_led_test) { + sleep_led_disable(); + led_set(host_keyboard_leds()); + } else { + sleep_led_enable(); + } + sleep_led_test = !sleep_led_test; break; #endif #ifdef BOOTMAGIC_ENABLE @@ -621,6 +630,7 @@ static bool mousekey_console(uint8_t code) /*********************************************************** * Utilities ***********************************************************/ +#if MOUSEKEY_ENABLE static uint8_t numkey2num(uint8_t code) { switch (code) { @@ -637,6 +647,7 @@ static uint8_t numkey2num(uint8_t code) } return 0; } +#endif static void switch_default_layer(uint8_t layer) {