summaryrefslogtreecommitdiff
path: root/common_features.mk
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-01-04 20:29:44 +0000
committerFlorian Didron <fdidron@users.noreply.github.com>2020-02-26 10:15:12 +0900
commit977fd47df5ee87635cd9a4675090c2e70611294f (patch)
tree5d5c3c6c1c470d476d8dd7b38c866f3782b480e3 /common_features.mk
parent65edbc6261ed732dcac3b6f6b3950015eab0934b (diff)
Move some common matrix code to a common location (#7699)
* Move some common matrix code to a common location * Refactor some 'custom_matrix_helper' logic to use custom matrix lite * Fix build for kinesis/stapelberg - abuse of vpath was picking up matrix.c from core when custom matrix was enabled * Add validation for CUSTOM_MATRIX
Diffstat (limited to 'common_features.mk')
-rw-r--r--common_features.mk26
1 files changed, 21 insertions, 5 deletions
diff --git a/common_features.mk b/common_features.mk
index f19782b818..b15de1b301 100644
--- a/common_features.mk
+++ b/common_features.mk
@@ -380,12 +380,28 @@ QUANTUM_SRC:= \
$(QUANTUM_DIR)/keymap_common.c \
$(QUANTUM_DIR)/keycode_config.c
-# Include the standard or split matrix code if needed
+
+
+VALID_CUSTOM_MATRIX_TYPES:= yes lite no
+
+CUSTOM_MATRIX ?= no
+
ifneq ($(strip $(CUSTOM_MATRIX)), yes)
- ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
- QUANTUM_SRC += $(QUANTUM_DIR)/split_common/matrix.c
- else
- QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c
+ ifeq ($(filter $(CUSTOM_MATRIX),$(VALID_CUSTOM_MATRIX_TYPES)),)
+ $(error CUSTOM_MATRIX="$(CUSTOM_MATRIX)" is not a valid custom matrix type)
+ endif
+
+ # Include common stuff for all non custom matrix users
+ QUANTUM_SRC += $(QUANTUM_DIR)/matrix_common.c
+
+ # if 'lite' then skip the actual matrix implementation
+ ifneq ($(strip $(CUSTOM_MATRIX)), lite)
+ # Include the standard or split matrix code if needed
+ ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
+ QUANTUM_SRC += $(QUANTUM_DIR)/split_common/matrix.c
+ else
+ QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c
+ endif
endif
endif