X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tmk_core%2Fcommon%2Fcommand.c;h=476fc6fe3c59cce819c0bfbeebbb0ace19bcdb6e;hb=fc2ca62a3b9552175eb7c27cc11f3a5af6cfae50;hp=7572b959797b33de6990bab1a3ef0967f53a29a1;hpb=e0ab1dcf4c6e97b81e4ea4c2521163e6917ef838;p=qmk_firmware.git diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c index 7572b9597..476fc6fe3 100644 --- a/tmk_core/common/command.c +++ b/tmk_core/common/command.c @@ -16,7 +16,7 @@ along with this program. If not, see . */ #include #include -#include +#include "wait.h" #include "keycode.h" #include "host.h" #include "keymap.h" @@ -33,22 +33,28 @@ along with this program. If not, see . #include "led.h" #include "command.h" #include "backlight.h" +#include "quantum.h" +#include "version.h" #ifdef MOUSEKEY_ENABLE #include "mousekey.h" #endif #ifdef PROTOCOL_PJRC -# include "usb_keyboard.h" -# ifdef EXTRAKEY_ENABLE -# include "usb_extra.h" -# endif + #include "usb_keyboard.h" + #ifdef EXTRAKEY_ENABLE + #include "usb_extra.h" + #endif #endif #ifdef PROTOCOL_VUSB -# include "usbdrv.h" + #include "usbdrv.h" #endif +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif /* AUDIO_ENABLE */ + static bool command_common(uint8_t code); static void command_common_help(void); @@ -61,7 +67,6 @@ static bool mousekey_console(uint8_t code); static void mousekey_console_help(void); #endif -static uint8_t numkey2num(uint8_t code); static void switch_default_layer(uint8_t layer); @@ -99,12 +104,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; } @@ -174,7 +181,7 @@ static void print_version(void) 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(QMK_VERSION) " (" __TIME__ " " __DATE__ ")\n"); /* build options */ print("OPTIONS:" @@ -213,8 +220,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; } @@ -230,7 +240,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); @@ -352,7 +362,12 @@ static bool command_common(uint8_t code) case MAGIC_KC(MAGIC_KEY_BOOTLOADER): clear_keyboard(); // clear to prevent stuck keys print("\n\nJumping to bootloader... "); - _delay_ms(1000); + #ifdef AUDIO_ENABLE + stop_all_notes(); + shutdown_user(); + #else + wait_ms(1000); + #endif bootloader_jump(); // not return break; @@ -421,10 +436,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 @@ -741,10 +757,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 @@ -753,7 +770,7 @@ static bool mousekey_console(uint8_t code) /*********************************************************** * Utilities ***********************************************************/ -static uint8_t numkey2num(uint8_t code) +uint8_t numkey2num(uint8_t code) { switch (code) { case KC_1: return 1;