diff options
| author | Alex Ong <the.onga@gmail.com> | 2019-01-04 19:39:14 +1100 |
|---|---|---|
| committer | Alex Ong <the.onga@gmail.com> | 2019-01-04 19:39:14 +1100 |
| commit | 47c91fc7f75ae0a477e55b687aa0fc30da0a283c (patch) | |
| tree | 65ad39452748ff2e6d4a83ce54ede6ca22c9ada9 /tmk_core/common/keyboard.c | |
| parent | ac9b88e8ccbbf38762871504cd827ff0d941c426 (diff) | |
| parent | 563ce3f225d981ce460c12ca5130dfe47af41df0 (diff) | |
| download | qmk_firmware-47c91fc7f75ae0a477e55b687aa0fc30da0a283c.tar.gz qmk_firmware-47c91fc7f75ae0a477e55b687aa0fc30da0a283c.zip | |
Merge branch 'master' of https://github.com/qmk/qmk_firmware
Diffstat (limited to 'tmk_core/common/keyboard.c')
| -rw-r--r-- | tmk_core/common/keyboard.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 13b3cb4c0..6f659b244 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c | |||
| @@ -72,6 +72,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 72 | #ifdef HD44780_ENABLE | 72 | #ifdef HD44780_ENABLE |
| 73 | # include "hd44780.h" | 73 | # include "hd44780.h" |
| 74 | #endif | 74 | #endif |
| 75 | #ifdef QWIIC_ENABLE | ||
| 76 | # include "qwiic.h" | ||
| 77 | #endif | ||
| 75 | 78 | ||
| 76 | #ifdef MATRIX_HAS_GHOST | 79 | #ifdef MATRIX_HAS_GHOST |
| 77 | extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; | 80 | extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; |
| @@ -120,6 +123,14 @@ static inline bool has_ghost_in_row(uint8_t row, matrix_row_t rowdata) | |||
| 120 | 123 | ||
| 121 | #endif | 124 | #endif |
| 122 | 125 | ||
| 126 | void disable_jtag(void) { | ||
| 127 | // To use PORTF disable JTAG with writing JTD bit twice within four cycles. | ||
| 128 | #if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega32U4__)) | ||
| 129 | MCUCR |= _BV(JTD); | ||
| 130 | MCUCR |= _BV(JTD); | ||
| 131 | #endif | ||
| 132 | } | ||
| 133 | |||
| 123 | /** \brief matrix_setup | 134 | /** \brief matrix_setup |
| 124 | * | 135 | * |
| 125 | * FIXME: needs doc | 136 | * FIXME: needs doc |
| @@ -133,6 +144,7 @@ void matrix_setup(void) { | |||
| 133 | * FIXME: needs doc | 144 | * FIXME: needs doc |
| 134 | */ | 145 | */ |
| 135 | void keyboard_setup(void) { | 146 | void keyboard_setup(void) { |
| 147 | disable_jtag(); | ||
| 136 | matrix_setup(); | 148 | matrix_setup(); |
| 137 | } | 149 | } |
| 138 | 150 | ||
| @@ -151,12 +163,10 @@ bool is_keyboard_master(void) { | |||
| 151 | */ | 163 | */ |
| 152 | void keyboard_init(void) { | 164 | void keyboard_init(void) { |
| 153 | timer_init(); | 165 | timer_init(); |
| 154 | // To use PORTF disable JTAG with writing JTD bit twice within four cycles. | ||
| 155 | #if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega32U4__)) | ||
| 156 | MCUCR |= _BV(JTD); | ||
| 157 | MCUCR |= _BV(JTD); | ||
| 158 | #endif | ||
| 159 | matrix_init(); | 166 | matrix_init(); |
| 167 | #ifdef QWIIC_ENABLE | ||
| 168 | qwiic_init(); | ||
| 169 | #endif | ||
| 160 | #ifdef PS2_MOUSE_ENABLE | 170 | #ifdef PS2_MOUSE_ENABLE |
| 161 | ps2_mouse_init(); | 171 | ps2_mouse_init(); |
| 162 | #endif | 172 | #endif |
| @@ -266,6 +276,10 @@ void keyboard_task(void) | |||
| 266 | 276 | ||
| 267 | MATRIX_LOOP_END: | 277 | MATRIX_LOOP_END: |
| 268 | 278 | ||
| 279 | #ifdef QWIIC_ENABLE | ||
| 280 | qwiic_task(); | ||
| 281 | #endif | ||
| 282 | |||
| 269 | #ifdef MOUSEKEY_ENABLE | 283 | #ifdef MOUSEKEY_ENABLE |
| 270 | // mousekey repeat & acceleration | 284 | // mousekey repeat & acceleration |
| 271 | mousekey_task(); | 285 | mousekey_task(); |
