]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - tmk_core/common/command.c
xt_usb: Fix XT soft reset
[max/tmk_keyboard.git] / tmk_core / common / command.c
index 8fb6db5638c3bee4bbbc5b853366a8e8a32f9b5b..54050bd950bb83113b00069a98aa7f04167d0cac 100644 (file)
@@ -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
@@ -232,13 +241,13 @@ static bool command_common(uint8_t code)
             break;
         case KC_D:
             if (debug_enable) {
-                print("\ndebug: on\n");
+                print("\ndebug: off\n");
                 debug_matrix   = false;
                 debug_keyboard = false;
                 debug_mouse    = false;
                 debug_enable   = false;
             } else {
-                print("\ndebug: off\n");
+                print("\ndebug: on\n");
                 debug_enable   = true;
             }
             break;
@@ -275,7 +284,7 @@ static bool command_common(uint8_t code)
             print("VID: " STR(VENDOR_ID) "(" STR(MANUFACTURER) ") "
                   "PID: " STR(PRODUCT_ID) "(" STR(PRODUCT) ") "
                   "VER: " STR(DEVICE_VER) "\n");
-            print("BUILD: " STR(VERSION) " (" __TIME__ " " __DATE__ ")\n");
+            print("BUILD: " STR(TMK_VERSION) " (" __TIME__ " " __DATE__ ")\n");
             /* build options */
             print("OPTIONS:"
 #ifdef PROTOCOL_PJRC
@@ -327,6 +336,9 @@ static bool command_common(uint8_t code)
             print_val_hex8(host_keyboard_leds());
             print_val_hex8(keyboard_protocol);
             print_val_hex8(keyboard_idle);
+#ifdef NKRO_ENABLE
+            print_val_hex8(keyboard_nkro);
+#endif
             print_val_hex32(timer_read32());
 
 #ifdef PROTOCOL_PJRC
@@ -347,10 +359,11 @@ static bool command_common(uint8_t code)
         case KC_N:
             clear_keyboard(); //Prevents stuck keys.
             keyboard_nkro = !keyboard_nkro;
-            if (keyboard_nkro)
+            if (keyboard_nkro) {
                 print("NKRO: on\n");
-            else
+            } else {
                 print("NKRO: off\n");
+            }
             break;
 #endif
         case KC_ESC:
@@ -604,10 +617,11 @@ static bool mousekey_console(uint8_t code)
             print("?");
             return false;
     }
-    if (mousekey_param)
+    if (mousekey_param) {
         xprintf("M%d> ", mousekey_param);
-    else
+    } else {
         print("M>" );
+    }
     return true;
 }
 #endif
@@ -616,6 +630,7 @@ static bool mousekey_console(uint8_t code)
 /***********************************************************
  * Utilities
  ***********************************************************/
+#if MOUSEKEY_ENABLE
 static uint8_t numkey2num(uint8_t code)
 {
     switch (code) {
@@ -632,6 +647,7 @@ static uint8_t numkey2num(uint8_t code)
     }
     return 0;
 }
+#endif
 
 static void switch_default_layer(uint8_t layer)
 {