Merge branch 'master' into debounce_refactor

# Conflicts:
#	tmk_core/common/keyboard.c
This commit is contained in:
Alex Ong 2019-01-04 19:43:45 +11:00
commit 2bb2977c13
3425 changed files with 216380 additions and 20651 deletions

View file

@ -73,6 +73,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];
@ -121,6 +124,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
@ -134,6 +145,7 @@ void matrix_setup(void) {
* FIXME: needs doc
*/
void keyboard_setup(void) {
disable_jtag();
matrix_setup();
}
@ -152,13 +164,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();
matrix_debounce_init();
#ifdef QWIIC_ENABLE
qwiic_init();
#endif
#ifdef PS2_MOUSE_ENABLE
ps2_mouse_init();
#endif
@ -256,6 +266,10 @@ void keyboard_task(void)
MATRIX_LOOP_END:
#ifdef QWIIC_ENABLE
qwiic_task();
#endif
#ifdef MOUSEKEY_ENABLE
// mousekey repeat & acceleration
mousekey_task();