diff options
| author | Pavlos Vinieratos <pvinis@gmail.com> | 2016-07-13 16:38:02 +0200 |
|---|---|---|
| committer | Pavlos Vinieratos <pvinis@gmail.com> | 2016-07-13 16:38:02 +0200 |
| commit | a28a6e5b79c819e5f9323f62686498eca3ef399f (patch) | |
| tree | f61856ff5d0ab34e5bab8dc69a5cda12f89d4b29 /quantum/quantum.c | |
| parent | a998a48673372e409991066d7d2d9ba282f79d59 (diff) | |
| download | qmk_firmware-a28a6e5b79c819e5f9323f62686498eca3ef399f.tar.gz qmk_firmware-a28a6e5b79c819e5f9323f62686498eca3ef399f.zip | |
extract reset keyboard into a function
that makes it easy to call reset_keyboard() from a function in a keymap
Diffstat (limited to 'quantum/quantum.c')
| -rw-r--r-- | quantum/quantum.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c index d5b9753b7..bc2da510f 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
| @@ -15,6 +15,19 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 15 | return true; | 15 | return true; |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | void reset_keyboard(void) { | ||
| 19 | clear_keyboard(); | ||
| 20 | #ifdef AUDIO_ENABLE | ||
| 21 | stop_all_notes(); | ||
| 22 | shutdown_user(); | ||
| 23 | #endif | ||
| 24 | wait_ms(250); | ||
| 25 | #ifdef CATERINA_BOOTLOADER | ||
| 26 | *(uint16_t *)0x0800 = 0x7777; // these two are a-star-specific | ||
| 27 | #endif | ||
| 28 | bootloader_jump(); | ||
| 29 | } | ||
| 30 | |||
| 18 | // Shift / paren setup | 31 | // Shift / paren setup |
| 19 | 32 | ||
| 20 | #ifndef LSPO_KEY | 33 | #ifndef LSPO_KEY |
| @@ -83,16 +96,7 @@ bool process_record_quantum(keyrecord_t *record) { | |||
| 83 | switch(keycode) { | 96 | switch(keycode) { |
| 84 | case RESET: | 97 | case RESET: |
| 85 | if (record->event.pressed) { | 98 | if (record->event.pressed) { |
| 86 | clear_keyboard(); | 99 | reset_keyboard(); |
| 87 | #ifdef AUDIO_ENABLE | ||
| 88 | stop_all_notes(); | ||
| 89 | shutdown_user(); | ||
| 90 | #endif | ||
| 91 | wait_ms(250); | ||
| 92 | #ifdef CATERINA_BOOTLOADER | ||
| 93 | *(uint16_t *)0x0800 = 0x7777; // these two are a-star-specific | ||
| 94 | #endif | ||
| 95 | bootloader_jump(); | ||
| 96 | } | 100 | } |
| 97 | return false; | 101 | return false; |
| 98 | break; | 102 | break; |
