]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - tmk_core/common/command.c
Merge branch 'master' into chibios
[max/tmk_keyboard.git] / tmk_core / common / command.c
index d59bb01bbcbd9151430fdf79444a84636a5cd9c9..4ef0b077d6e63ce594ec69d7078088b5a7332f4e 100644 (file)
@@ -16,7 +16,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 #include <stdint.h>
 #include <stdbool.h>
-#include <util/delay.h>
+#include "wait.h"
 #include "keycode.h"
 #include "host.h"
 #include "keymap.h"
@@ -97,12 +97,14 @@ bool command_proc(uint8_t code)
 bool command_extra(uint8_t code) __attribute__ ((weak));
 bool command_extra(uint8_t code)
 {
+    (void)code;
     return false;
 }
 
 bool command_console_extra(uint8_t code) __attribute__ ((weak));
 bool command_console_extra(uint8_t code)
 {
+    (void)code;
     return false;
 }
 
@@ -178,7 +180,9 @@ static void print_eeconfig(void)
 
 static bool command_common(uint8_t code)
 {
+#ifdef KEYBOARD_LOCK_ENABLE
     static host_driver_t *host_driver = 0;
+#endif
     switch (code) {
 #ifdef SLEEP_LED_ENABLE
         case KC_Z:
@@ -223,7 +227,7 @@ static bool command_common(uint8_t code)
         case KC_PAUSE:
             clear_keyboard();
             print("\n\nbootloader... ");
-            _delay_ms(1000);
+            wait_ms(1000);
             bootloader_jump(); // not return
             break;
         case KC_D:
@@ -283,6 +287,9 @@ static bool command_common(uint8_t code)
 #ifdef PROTOCOL_VUSB
             " VUSB"
 #endif
+#ifdef PROTOCOL_CHIBIOS
+            " CHIBIOS"
+#endif
 #ifdef BOOTMAGIC_ENABLE
             " BOOTMAGIC"
 #endif
@@ -307,8 +314,13 @@ static bool command_common(uint8_t code)
             " " STR(BOOTLOADER_SIZE) "\n");
 
             print("GCC: " STR(__GNUC__) "." STR(__GNUC_MINOR__) "." STR(__GNUC_PATCHLEVEL__)
+#if defined(__AVR__)
                   " AVR-LIBC: " __AVR_LIBC_VERSION_STRING__
                   " AVR_ARCH: avr" STR(__AVR_ARCH__) "\n");
+#elif defined(__arm__)
+            // TODO
+            );
+#endif
             break;
         case KC_S:
             print("\n\t- Status -\n");
@@ -318,7 +330,7 @@ static bool command_common(uint8_t code)
 #ifdef NKRO_ENABLE
             print_val_hex8(keyboard_nkro);
 #endif
-            print_val_hex32(timer_count);
+            print_val_hex32(timer_read32());
 
 #ifdef PROTOCOL_PJRC
             print_val_hex8(UDCON);