]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - tmk_core/common/command.c
Add ChibiOS support for QMK (#465)
[qmk_firmware.git] / tmk_core / common / command.c
index 187a2b9496d0b7443520c9392e131746fe8c3acf..084c9fe1555fac3b5d44d8a12c7f72da1d37865c 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"
@@ -103,12 +103,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;
 }
 
@@ -217,8 +219,11 @@ static void print_version(void)
            " " 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");
+          " AVR_ARCH: avr" STR(__AVR_ARCH__)
+#endif
+                 "\n");
 
        return;
 }
@@ -234,7 +239,7 @@ static void print_status(void)
 #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);
@@ -360,7 +365,7 @@ static bool command_common(uint8_t code)
                    stop_all_notes();
                 shutdown_user();
             #else
-                   _delay_ms(1000);
+                   wait_ms(1000);
             #endif
             bootloader_jump(); // not return
             break;
@@ -430,10 +435,11 @@ static bool command_common(uint8_t code)
         case MAGIC_KC(MAGIC_KEY_NKRO):
             clear_keyboard(); // clear to prevent stuck keys
             keyboard_nkro = !keyboard_nkro;
-            if (keyboard_nkro)
+            if (keyboard_nkro) {
                 print("NKRO: on\n");
-            else
+            } else {
                 print("NKRO: off\n");
+            }
             break;
 #endif
 
@@ -750,10 +756,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