]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Merge branch 'master' into debounce_refactor
authorAlex Ong <the.onga@gmail.com>
Fri, 4 Jan 2019 08:43:45 +0000 (19:43 +1100)
committerAlex Ong <the.onga@gmail.com>
Fri, 4 Jan 2019 08:43:45 +0000 (19:43 +1100)
# Conflicts:
# tmk_core/common/keyboard.c

1  2 
quantum/matrix.c
tmk_core/common.mk
tmk_core/common/keyboard.c

index bc7eb6b585d125781dec55b7bce2330a392dfa6d,9b5ce33d239599779bd597b53c689b8fcc2cc768..292171490c2ae0a98b4d15583b18aa6dc3d1fe72
@@@ -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))
index 85f903fdae3a0ba73b1c970498f0814a2d7f419e,063115acb1ab803bcb4deabc228eeb0124a13839..7a7b3928f49441ed7d97e8b366388fd61e873542
@@@ -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
index fe626efb3505f6579519abf7f9579bc9a2e5757e,6f659b2440a9f9e29c8f325c440f31145bbf2668..1bfd4c9cca01d42eade86ed2828da3ac440851bb
@@@ -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