diff options
Diffstat (limited to 'tmk.c')
| -rw-r--r-- | tmk.c | 17 |
1 files changed, 7 insertions, 10 deletions
| @@ -36,6 +36,7 @@ | |||
| 36 | #include "util.h" | 36 | #include "util.h" |
| 37 | #include "controller.h" | 37 | #include "controller.h" |
| 38 | #include "timer.h" | 38 | #include "timer.h" |
| 39 | #include "jump_bootloader.h" | ||
| 39 | 40 | ||
| 40 | 41 | ||
| 41 | #define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) | 42 | #define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) |
| @@ -65,14 +66,8 @@ int main(void) | |||
| 65 | 66 | ||
| 66 | matrix_init(); | 67 | matrix_init(); |
| 67 | matrix_scan(); | 68 | matrix_scan(); |
| 68 | // debug on by pressing down any 4 or more keys during boot time. | 69 | // bootloader comes up when any 4 or more keys are pressed at startup |
| 69 | if (matrix_key_count() >= 4) { | 70 | if (matrix_key_count() >= 4) { |
| 70 | print_enable = true; | ||
| 71 | debug_enable = true; | ||
| 72 | } | ||
| 73 | |||
| 74 | /* wait for debug pipe ready */ | ||
| 75 | if (print_enable) { | ||
| 76 | #ifdef DEBUG_LED | 71 | #ifdef DEBUG_LED |
| 77 | for (int i = 0; i < 6; i++) { | 72 | for (int i = 0; i < 6; i++) { |
| 78 | DEBUG_LED_CONFIG; | 73 | DEBUG_LED_CONFIG; |
| @@ -82,11 +77,13 @@ int main(void) | |||
| 82 | _delay_ms(500); | 77 | _delay_ms(500); |
| 83 | } | 78 | } |
| 84 | #else | 79 | #else |
| 85 | _delay_ms(6000); | 80 | _delay_ms(5000); |
| 86 | #endif | 81 | #endif |
| 82 | print_enable = true; | ||
| 83 | print("jump to bootloader...\n"); | ||
| 84 | _delay_ms(1000); | ||
| 85 | jump_bootloader(); // not return | ||
| 87 | } | 86 | } |
| 88 | // print description | ||
| 89 | print(STR(DESCRIPTION) "\n"); | ||
| 90 | 87 | ||
| 91 | while (1) { | 88 | while (1) { |
| 92 | proc_matrix(); | 89 | proc_matrix(); |
