summaryrefslogtreecommitdiff
path: root/tmk_core/common/keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common/keyboard.c')
-rw-r--r--tmk_core/common/keyboard.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c
index 13b3cb4c0c..6f659b2440 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/>.
#ifdef HD44780_ENABLE
# include "hd44780.h"
#endif
+#ifdef QWIIC_ENABLE
+# include "qwiic.h"
+#endif
#ifdef MATRIX_HAS_GHOST
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)
#endif
+void disable_jtag(void) {
+// 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
+}
+
/** \brief matrix_setup
*
* FIXME: needs doc
@@ -133,6 +144,7 @@ void matrix_setup(void) {
* FIXME: needs doc
*/
void keyboard_setup(void) {
+ disable_jtag();
matrix_setup();
}
@@ -151,12 +163,10 @@ 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 QWIIC_ENABLE
+ qwiic_init();
+#endif
#ifdef PS2_MOUSE_ENABLE
ps2_mouse_init();
#endif
@@ -266,6 +276,10 @@ void keyboard_task(void)
MATRIX_LOOP_END:
+#ifdef QWIIC_ENABLE
+ qwiic_task();
+#endif
+
#ifdef MOUSEKEY_ENABLE
// mousekey repeat & acceleration
mousekey_task();