aboutsummaryrefslogtreecommitdiffstats
path: root/tmk_core/common/keyboard.c
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2018-06-21 20:29:40 -0700
committerJack Humbert <jack.humb@gmail.com>2018-06-28 08:52:21 -0400
commitee3b9d2ef08b3a176257b1082a0f367b9f29fc67 (patch)
tree4e414456a4fbfe2d06e9b94f5171958e07510f54 /tmk_core/common/keyboard.c
parentc5db272c911e886a0674bbf959b54e7b50c36636 (diff)
downloadfirmware-ee3b9d2ef08b3a176257b1082a0f367b9f29fc67.tar.gz
firmware-ee3b9d2ef08b3a176257b1082a0f367b9f29fc67.tar.bz2
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
Diffstat (limited to 'tmk_core/common/keyboard.c')
-rw-r--r--tmk_core/common/keyboard.c7
1 files changed, 6 insertions, 1 deletions
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) {
*/
void keyboard_init(void) {
timer_init();
+// To use PORTF disable JTAG with writing JTD bit twice within four cycles.
+#if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega32U4__))
+ MCUCR |= _BV(JTD);
+ MCUCR |= _BV(JTD);
+#endif
matrix_init();
#ifdef PS2_MOUSE_ENABLE
ps2_mouse_init();
@@ -185,7 +190,7 @@ void keyboard_init(void) {
/** \brief Keyboard task: Do keyboard routine jobs
*
- * Do routine keyboard jobs:
+ * Do routine keyboard jobs:
*
* * scan matrix
* * handle mouse movements