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
This commit is contained in:
parent
c1feeaa57f
commit
dcb7ca3f79
12 changed files with 124 additions and 283 deletions
|
@ -374,12 +374,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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue