#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))
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