aboutsummaryrefslogtreecommitdiff
path: root/common_features.mk
diff options
context:
space:
mode:
authorJames Laird-Wah <james@laird-wah.net>2018-09-28 00:40:18 +1000
committerJack Humbert <jack.humb@gmail.com>2018-09-27 10:40:18 -0400
commitf70f45ee677a2a39a759052a356e0c5d82e25424 (patch)
treec0d6a6d5a5791a57309b3deb398ca1dfcc499f78 /common_features.mk
parent12ad59f99de0ecd2c81b92587c2858b3fb39523c (diff)
downloadqmk_firmware-f70f45ee677a2a39a759052a356e0c5d82e25424.tar.gz
qmk_firmware-f70f45ee677a2a39a759052a356e0c5d82e25424.zip
RGB Matrix refactoring to open up for new drivers (#3913)
* rgb_matrix: use a driver ops struct This is intended to avoid #ifdef proliferation on adding more drivers, eg. model01, which use different architectures. * rgb_matrix: document driver struct members * rgb_matrix: remove unused LED testing code * rgb_matrix: don't build into IS31x drivers unless being used * rgb_matrix: refactor make config options This ensures that the necessary files are included for any custom RGB_MATRIX_ENABLE value, without having to add entries here for specific boards. This particularly affects model01 because its controller is integrated and won't be used anywhere else, so it's preferable not to put it in common_features.mk. This now validates the value of RGB_MATRIX_ENABLE. It was necessary to fix an error in ergodox_ez rules.mk using the wrong comment separator, yielding an invalid value. * IS31x drivers: don't write the control registers all the time This is only needed when they are changed. This is done in init() and board- or keymap-specific code is free to make further changes. * rgb_matrix: move structs from chip drivers to rgb_matrix_drivers.c This approach is specific to the rgb_matrix functionality, so keep it neatly separated from the raw chip drivers.
Diffstat (limited to 'common_features.mk')
-rw-r--r--common_features.mk24
1 files changed, 11 insertions, 13 deletions
diff --git a/common_features.mk b/common_features.mk
index 7af778980..6c835abde 100644
--- a/common_features.mk
+++ b/common_features.mk
@@ -114,37 +114,35 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
114 endif 114 endif
115endif 115endif
116 116
117ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) 117RGB_MATRIX_ENABLE ?= no
118VALID_MATRIX_TYPES := yes IS31FL3731L IS31FL3733L custom
119ifneq ($(strip $(RGB_MATRIX_ENABLE)), no)
120ifeq ($(filter $(RGB_MATRIX_ENABLE),$(VALID_MATRIX_TYPES)),)
121 $(error RGB_MATRIX_ENABLE="$(RGB_MATRIX_ENABLE)" is not a valid matrix type)
122endif
118 OPT_DEFS += -DRGB_MATRIX_ENABLE 123 OPT_DEFS += -DRGB_MATRIX_ENABLE
119 OPT_DEFS += -DIS31FL3731
120 COMMON_VPATH += $(DRIVER_PATH)/issi
121 SRC += is31fl3731.c
122 SRC += i2c_master.c
123 SRC += $(QUANTUM_DIR)/color.c 124 SRC += $(QUANTUM_DIR)/color.c
124 SRC += $(QUANTUM_DIR)/rgb_matrix.c 125 SRC += $(QUANTUM_DIR)/rgb_matrix.c
126 SRC += $(QUANTUM_DIR)/rgb_matrix_drivers.c
125 CIE1931_CURVE = yes 127 CIE1931_CURVE = yes
126endif 128endif
127 129
130ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
131 RGB_MATRIX_ENABLE = IS31FL3731
132endif
133
128ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3731) 134ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3731)
129 OPT_DEFS += -DRGB_MATRIX_ENABLE
130 OPT_DEFS += -DIS31FL3731 135 OPT_DEFS += -DIS31FL3731
131 COMMON_VPATH += $(DRIVER_PATH)/issi 136 COMMON_VPATH += $(DRIVER_PATH)/issi
132 SRC += is31fl3731.c 137 SRC += is31fl3731.c
133 SRC += i2c_master.c 138 SRC += i2c_master.c
134 SRC += $(QUANTUM_DIR)/color.c
135 SRC += $(QUANTUM_DIR)/rgb_matrix.c
136 CIE1931_CURVE = yes
137endif 139endif
138 140
139ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3733) 141ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3733)
140 OPT_DEFS += -DRGB_MATRIX_ENABLE
141 OPT_DEFS += -DIS31FL3733 142 OPT_DEFS += -DIS31FL3733
142 COMMON_VPATH += $(DRIVER_PATH)/issi 143 COMMON_VPATH += $(DRIVER_PATH)/issi
143 SRC += is31fl3733.c 144 SRC += is31fl3733.c
144 SRC += i2c_master.c 145 SRC += i2c_master.c
145 SRC += $(QUANTUM_DIR)/color.c
146 SRC += $(QUANTUM_DIR)/rgb_matrix.c
147 CIE1931_CURVE = yes
148endif 146endif
149 147
150ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) 148ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)