diff options
| author | Drashna Jaelre <drashna@live.com> | 2018-06-21 20:29:40 -0700 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2018-06-28 08:52:21 -0400 |
| commit | ee3b9d2ef08b3a176257b1082a0f367b9f29fc67 (patch) | |
| tree | 4e414456a4fbfe2d06e9b94f5171958e07510f54 | |
| parent | c5db272c911e886a0674bbf959b54e7b50c36636 (diff) | |
| download | qmk_firmware-ee3b9d2ef08b3a176257b1082a0f367b9f29fc67.tar.gz qmk_firmware-ee3b9d2ef08b3a176257b1082a0f367b9f29fc67.zip | |
Disable JTAG in keyboard init
So that all boards, present and future will have JTAG disabled, even if using a custom matrix
| -rw-r--r-- | quantum/matrix.c | 6 | ||||
| -rw-r--r-- | tmk_core/common/keyboard.c | 7 |
2 files changed, 6 insertions, 7 deletions
diff --git a/quantum/matrix.c b/quantum/matrix.c index 5337e2626..3600d4e7b 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c | |||
| @@ -148,12 +148,6 @@ uint8_t matrix_cols(void) { | |||
| 148 | 148 | ||
| 149 | void matrix_init(void) { | 149 | void matrix_init(void) { |
| 150 | 150 | ||
| 151 | // To use PORTF disable JTAG with writing JTD bit twice within four cycles. | ||
| 152 | #if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega32U4__)) | ||
| 153 | MCUCR |= _BV(JTD); | ||
| 154 | MCUCR |= _BV(JTD); | ||
| 155 | #endif | ||
| 156 | |||
| 157 | // initialize row and col | 151 | // initialize row and col |
| 158 | #if (DIODE_DIRECTION == COL2ROW) | 152 | #if (DIODE_DIRECTION == COL2ROW) |
| 159 | unselect_rows(); | 153 | unselect_rows(); |
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 4eff764e2..d3fbe2d87 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c | |||
| @@ -148,6 +148,11 @@ bool is_keyboard_master(void) { | |||
| 148 | */ | 148 | */ |
| 149 | void keyboard_init(void) { | 149 | void keyboard_init(void) { |
| 150 | timer_init(); | 150 | timer_init(); |
| 151 | // To use PORTF disable JTAG with writing JTD bit twice within four cycles. | ||
| 152 | #if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega32U4__)) | ||
| 153 | MCUCR |= _BV(JTD); | ||
| 154 | MCUCR |= _BV(JTD); | ||
| 155 | #endif | ||
| 151 | matrix_init(); | 156 | matrix_init(); |
| 152 | #ifdef PS2_MOUSE_ENABLE | 157 | #ifdef PS2_MOUSE_ENABLE |
| 153 | ps2_mouse_init(); | 158 | ps2_mouse_init(); |
| @@ -185,7 +190,7 @@ void keyboard_init(void) { | |||
| 185 | 190 | ||
| 186 | /** \brief Keyboard task: Do keyboard routine jobs | 191 | /** \brief Keyboard task: Do keyboard routine jobs |
| 187 | * | 192 | * |
| 188 | * Do routine keyboard jobs: | 193 | * Do routine keyboard jobs: |
| 189 | * | 194 | * |
| 190 | * * scan matrix | 195 | * * scan matrix |
| 191 | * * handle mouse movements | 196 | * * handle mouse movements |
