]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - tmk_core/common/command.c
core: Fix sleep_led
[max/tmk_keyboard.git] / tmk_core / common / command.c
index 6920970020cc3f0a8ec72e645940b39132074362..bb471e887e5d7de3638888c1062a623f4616f9e3 100644 (file)
@@ -182,14 +182,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