diff options
| author | IBNobody <protospherex@gmail.com> | 2016-04-18 15:47:10 -0500 |
|---|---|---|
| committer | IBNobody <protospherex@gmail.com> | 2016-04-18 15:47:10 -0500 |
| commit | cbcf0abe62b764a9f3d80848611dca8291d93eb8 (patch) | |
| tree | 2014b1d839bfaa29acdbf432265d908562304834 /tmk_core/common/command.c | |
| parent | d5cc31d7d4fc1a36fc3e3e0018369cb52553f50f (diff) | |
| parent | 4f4b5b8c18d4f1bf4fd4c51ad6f316501dfbd6cc (diff) | |
| download | qmk_firmware-cbcf0abe62b764a9f3d80848611dca8291d93eb8.tar.gz qmk_firmware-cbcf0abe62b764a9f3d80848611dca8291d93eb8.zip | |
Merge remote-tracking branch 'refs/remotes/origin/personal_atomic_planck'
Diffstat (limited to 'tmk_core/common/command.c')
| -rw-r--r-- | tmk_core/common/command.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c index b4cd3ca56..f06abaf7f 100644 --- a/tmk_core/common/command.c +++ b/tmk_core/common/command.c | |||
| @@ -49,6 +49,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 49 | # include "usbdrv.h" | 49 | # include "usbdrv.h" |
| 50 | #endif | 50 | #endif |
| 51 | 51 | ||
| 52 | #ifdef AUDIO_ENABLE | ||
| 53 | #include "audio.h" | ||
| 54 | #endif /* AUDIO_ENABLE */ | ||
| 55 | |||
| 52 | 56 | ||
| 53 | static bool command_common(uint8_t code); | 57 | static bool command_common(uint8_t code); |
| 54 | static void command_common_help(void); | 58 | static void command_common_help(void); |
| @@ -122,7 +126,7 @@ static void command_common_help(void) | |||
| 122 | STR(MAGIC_KEY_VERSION ) ": Version\n" | 126 | STR(MAGIC_KEY_VERSION ) ": Version\n" |
| 123 | STR(MAGIC_KEY_STATUS ) ": Status\n" | 127 | STR(MAGIC_KEY_STATUS ) ": Status\n" |
| 124 | STR(MAGIC_KEY_CONSOLE ) ": Activate Console Mode\n" | 128 | STR(MAGIC_KEY_CONSOLE ) ": Activate Console Mode\n" |
| 125 | 129 | ||
| 126 | #if MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM | 130 | #if MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM |
| 127 | STR(MAGIC_KEY_LAYER0 ) ": Switch to Layer 0\n" | 131 | STR(MAGIC_KEY_LAYER0 ) ": Switch to Layer 0\n" |
| 128 | STR(MAGIC_KEY_LAYER1 ) ": Switch to Layer 1\n" | 132 | STR(MAGIC_KEY_LAYER1 ) ": Switch to Layer 1\n" |
| @@ -136,11 +140,11 @@ static void command_common_help(void) | |||
| 136 | STR(MAGIC_KEY_LAYER9 ) ": Switch to Layer 9\n" | 140 | STR(MAGIC_KEY_LAYER9 ) ": Switch to Layer 9\n" |
| 137 | #endif | 141 | #endif |
| 138 | 142 | ||
| 139 | #if MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS | 143 | #if MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS |
| 140 | "F1-F10: Switch to Layer 0-9 (F10 = L0)\n" | 144 | "F1-F10: Switch to Layer 0-9 (F10 = L0)\n" |
| 141 | #endif | 145 | #endif |
| 142 | 146 | ||
| 143 | #if MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS | 147 | #if MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS |
| 144 | "0-9: Switch to Layer 0-9\n" | 148 | "0-9: Switch to Layer 0-9\n" |
| 145 | #endif | 149 | #endif |
| 146 | 150 | ||
| @@ -251,6 +255,7 @@ static void print_status(void) | |||
| 251 | #ifdef BOOTMAGIC_ENABLE | 255 | #ifdef BOOTMAGIC_ENABLE |
| 252 | static void print_eeconfig(void) | 256 | static void print_eeconfig(void) |
| 253 | { | 257 | { |
| 258 | #ifndef NO_PRINT | ||
| 254 | print("default_layer: "); print_dec(eeconfig_read_default_layer()); print("\n"); | 259 | print("default_layer: "); print_dec(eeconfig_read_default_layer()); print("\n"); |
| 255 | 260 | ||
| 256 | debug_config_t dc; | 261 | debug_config_t dc; |
| @@ -279,9 +284,12 @@ static void print_eeconfig(void) | |||
| 279 | print("backlight_config.raw: "); print_hex8(bc.raw); print("\n"); | 284 | print("backlight_config.raw: "); print_hex8(bc.raw); print("\n"); |
| 280 | print(".enable: "); print_dec(bc.enable); print("\n"); | 285 | print(".enable: "); print_dec(bc.enable); print("\n"); |
| 281 | print(".level: "); print_dec(bc.level); print("\n"); | 286 | print(".level: "); print_dec(bc.level); print("\n"); |
| 282 | #endif | 287 | #endif /* BACKLIGHT_ENABLE */ |
| 288 | |||
| 289 | #endif /* !NO_PRINT */ | ||
| 290 | |||
| 283 | } | 291 | } |
| 284 | #endif | 292 | #endif /* BOOTMAGIC_ENABLE */ |
| 285 | 293 | ||
| 286 | static bool command_common(uint8_t code) | 294 | static bool command_common(uint8_t code) |
| 287 | { | 295 | { |
| @@ -305,7 +313,7 @@ static bool command_common(uint8_t code) | |||
| 305 | #ifdef BOOTMAGIC_ENABLE | 313 | #ifdef BOOTMAGIC_ENABLE |
| 306 | 314 | ||
| 307 | // print stored eeprom config | 315 | // print stored eeprom config |
| 308 | case MAGIC_KC(MAGIC_KEY_EEPROM): | 316 | case MAGIC_KC(MAGIC_KEY_EEPROM): |
| 309 | print("eeconfig:\n"); | 317 | print("eeconfig:\n"); |
| 310 | print_eeconfig(); | 318 | print_eeconfig(); |
| 311 | break; | 319 | break; |
| @@ -348,6 +356,9 @@ static bool command_common(uint8_t code) | |||
| 348 | case MAGIC_KC(MAGIC_KEY_BOOTLOADER): | 356 | case MAGIC_KC(MAGIC_KEY_BOOTLOADER): |
| 349 | clear_keyboard(); // clear to prevent stuck keys | 357 | clear_keyboard(); // clear to prevent stuck keys |
| 350 | print("\n\nJumping to bootloader... "); | 358 | print("\n\nJumping to bootloader... "); |
| 359 | #ifdef AUDIO_ENABLE | ||
| 360 | play_goodbye_tone(); | ||
| 361 | #endif | ||
| 351 | _delay_ms(1000); | 362 | _delay_ms(1000); |
| 352 | bootloader_jump(); // not return | 363 | bootloader_jump(); // not return |
| 353 | break; | 364 | break; |
| @@ -369,7 +380,7 @@ static bool command_common(uint8_t code) | |||
| 369 | break; | 380 | break; |
| 370 | 381 | ||
| 371 | // debug matrix toggle | 382 | // debug matrix toggle |
| 372 | case MAGIC_KC(MAGIC_KEY_DEBUG_MATRIX): | 383 | case MAGIC_KC(MAGIC_KEY_DEBUG_MATRIX): |
| 373 | debug_matrix = !debug_matrix; | 384 | debug_matrix = !debug_matrix; |
| 374 | if (debug_matrix) { | 385 | if (debug_matrix) { |
| 375 | print("\nmatrix: on\n"); | 386 | print("\nmatrix: on\n"); |
| @@ -380,7 +391,7 @@ static bool command_common(uint8_t code) | |||
| 380 | break; | 391 | break; |
| 381 | 392 | ||
| 382 | // debug keyboard toggle | 393 | // debug keyboard toggle |
| 383 | case MAGIC_KC(MAGIC_KEY_DEBUG_KBD): | 394 | case MAGIC_KC(MAGIC_KEY_DEBUG_KBD): |
| 384 | debug_keyboard = !debug_keyboard; | 395 | debug_keyboard = !debug_keyboard; |
| 385 | if (debug_keyboard) { | 396 | if (debug_keyboard) { |
| 386 | print("\nkeyboard: on\n"); | 397 | print("\nkeyboard: on\n"); |
| @@ -551,6 +562,7 @@ static uint8_t mousekey_param = 0; | |||
| 551 | 562 | ||
| 552 | static void mousekey_param_print(void) | 563 | static void mousekey_param_print(void) |
| 553 | { | 564 | { |
| 565 | #ifndef NO_PRINT | ||
| 554 | print("\n\t- Values -\n"); | 566 | print("\n\t- Values -\n"); |
| 555 | print("1: delay(*10ms): "); pdec(mk_delay); print("\n"); | 567 | print("1: delay(*10ms): "); pdec(mk_delay); print("\n"); |
| 556 | print("2: interval(ms): "); pdec(mk_interval); print("\n"); | 568 | print("2: interval(ms): "); pdec(mk_interval); print("\n"); |
| @@ -558,6 +570,8 @@ static void mousekey_param_print(void) | |||
| 558 | print("4: time_to_max: "); pdec(mk_time_to_max); print("\n"); | 570 | print("4: time_to_max: "); pdec(mk_time_to_max); print("\n"); |
| 559 | print("5: wheel_max_speed: "); pdec(mk_wheel_max_speed); print("\n"); | 571 | print("5: wheel_max_speed: "); pdec(mk_wheel_max_speed); print("\n"); |
| 560 | print("6: wheel_time_to_max: "); pdec(mk_wheel_time_to_max); print("\n"); | 572 | print("6: wheel_time_to_max: "); pdec(mk_wheel_time_to_max); print("\n"); |
| 573 | #endif /* !NO_PRINT */ | ||
| 574 | |||
| 561 | } | 575 | } |
| 562 | 576 | ||
| 563 | //#define PRINT_SET_VAL(v) print(#v " = "); print_dec(v); print("\n"); | 577 | //#define PRINT_SET_VAL(v) print(#v " = "); print_dec(v); print("\n"); |
| @@ -677,7 +691,7 @@ static void mousekey_console_help(void) | |||
| 677 | "pgdown: -10\n" | 691 | "pgdown: -10\n" |
| 678 | "\n" | 692 | "\n" |
| 679 | "speed = delta * max_speed * (repeat / time_to_max)\n"); | 693 | "speed = delta * max_speed * (repeat / time_to_max)\n"); |
| 680 | xprintf("where delta: cursor=%d, wheel=%d\n" | 694 | xprintf("where delta: cursor=%d, wheel=%d\n" |
| 681 | "See http://en.wikipedia.org/wiki/Mouse_keys\n", MOUSEKEY_MOVE_DELTA, MOUSEKEY_WHEEL_DELTA); | 695 | "See http://en.wikipedia.org/wiki/Mouse_keys\n", MOUSEKEY_MOVE_DELTA, MOUSEKEY_WHEEL_DELTA); |
| 682 | } | 696 | } |
| 683 | 697 | ||
