From: Alex Ong Date: Fri, 4 Jan 2019 08:43:45 +0000 (+1100) Subject: Merge branch 'master' into debounce_refactor X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=2bb2977c133646c4e056960e72029270d77cc1eb;p=qmk_firmware.git Merge branch 'master' into debounce_refactor # Conflicts: # tmk_core/common/keyboard.c --- 2bb2977c133646c4e056960e72029270d77cc1eb diff --cc quantum/matrix.c index bc7eb6b58,9b5ce33d2..292171490 --- a/quantum/matrix.c +++ b/quantum/matrix.c @@@ -25,8 -22,20 +22,9 @@@ along with this program. If not, see < #include "util.h" #include "matrix.h" #include "timer.h" + #include "quantum.h" -/* Set 0 if debouncing isn't needed */ - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif - -#if (DEBOUNCING_DELAY > 0) - static uint16_t debouncing_time; - static bool debouncing = false; -#endif - #if (MATRIX_COLS <= 8) # define print_matrix_header() print("\nr/c 01234567\n") # define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) diff --cc tmk_core/common.mk index 85f903fda,063115acb..7a7b3928f --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@@ -41,25 -60,23 +62,36 @@@ ifeq ($(PLATFORM),TEST TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom.c endif - +# Debounce Modules. If implemented in matrix.c, don't use these. +ifeq ($(strip $(SPLIT_KEYBOARD)), yes) + # Do nothing, debouncing is inside matrix.c inside split_common +else ifeq ($(strip $(DEBOUNCE_ALGO)), manual) + # Do nothing. do your debouncing in matrix.c +else ifeq ($(strip $(DEBOUNCE_ALGO)), sym_g) + TMK_COMMON_SRC += $(DEBOUNCE)/debounce_sym_g.c +else ifeq ($(strip $(DEBOUNCE_ALGO)), eager_pk) + TMK_COMMON_SRC += $(DEBOUNCE)/debounce_eager_pk.c +else ifeq ($(strip $(CUSTOM_MATRIX)), yes) + # Do nothing. Custom matrix code. +else # default algorithm + TMK_COMMON_SRC += $(DEBOUNCE)/debounce_sym_g.c +endif # Option modules - ifeq ($(strip $(BOOTMAGIC_ENABLE)), yes) + BOOTMAGIC_ENABLE ?= no + VALID_MAGIC_TYPES := yes full lite + ifneq ($(strip $(BOOTMAGIC_ENABLE)), no) + ifeq ($(filter $(BOOTMAGIC_ENABLE),$(VALID_MAGIC_TYPES)),) + $(error BOOTMAGIC_ENABLE="$(BOOTMAGIC_ENABLE)" is not a valid type of magic) + endif + ifeq ($(strip $(BOOTMAGIC_ENABLE)), lite) + TMK_COMMON_DEFS += -DBOOTMAGIC_LITE + TMK_COMMON_DEFS += -DMAGIC_ENABLE + TMK_COMMON_SRC += $(COMMON_DIR)/magic.c + else TMK_COMMON_DEFS += -DBOOTMAGIC_ENABLE TMK_COMMON_SRC += $(COMMON_DIR)/bootmagic.c + endif else TMK_COMMON_DEFS += -DMAGIC_ENABLE TMK_COMMON_SRC += $(COMMON_DIR)/magic.c diff --cc tmk_core/common/keyboard.c index fe626efb3,6f659b244..1bfd4c9cc --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c @@@ -152,13 -163,10 +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