From 67ff20423db89a93c2244d71be75878c8c2127f6 Mon Sep 17 00:00:00 2001 From: mtei <2170248+mtei@users.noreply.github.com> Date: Mon, 2 Nov 2020 01:09:19 +0900 Subject: [PATCH] add DEBUG_MATRIX_SCAN_RATE_ENABLE to common_features.mk Add a Make variable to easily enable DEBUG_MATRIX_SCAN_RATE on the command line. eg. ``` make DEBUG_MATRIX_SCAN_RATE_ENABLE=yes KEYBOARD:KEYMAP ``` --- common_features.mk | 5 +++++ tmk_core/common/keyboard.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/common_features.mk b/common_features.mk index 32028c8af591..5a1713ec36f5 100644 --- a/common_features.mk +++ b/common_features.mk @@ -20,6 +20,11 @@ QUANTUM_SRC += \ $(QUANTUM_DIR)/keymap_common.c \ $(QUANTUM_DIR)/keycode_config.c +ifeq ($(strip $(DEBUG_MATRIX_SCAN_RATE_ENABLE)), yes) + OPT_DEFS += -DDEBUG_MATRIX_SCAN_RATE + CONSOLE_ENABLE = yes +endif + ifeq ($(strip $(API_SYSEX_ENABLE)), yes) OPT_DEFS += -DAPI_SYSEX_ENABLE OPT_DEFS += -DAPI_ENABLE diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 2c762ae235ca..18bd56a8ca3f 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c @@ -299,6 +299,10 @@ void keyboard_init(void) { dip_switch_init(); #endif +#if defined(DEBUG_MATRIX_SCAN_RATE) && defined(CONSOLE_ENABLE) + debug_enable = true; +#endif + keyboard_post_init_kb(); /* Always keep this last */ }