diff options
Diffstat (limited to 'common_features.mk')
| -rw-r--r-- | common_features.mk | 46 |
1 files changed, 38 insertions, 8 deletions
diff --git a/common_features.mk b/common_features.mk index 8ac53ec45..95b59937c 100644 --- a/common_features.mk +++ b/common_features.mk | |||
| @@ -154,18 +154,38 @@ else | |||
| 154 | endif | 154 | endif |
| 155 | endif | 155 | endif |
| 156 | 156 | ||
| 157 | RGBLIGHT_ENABLE ?= no | ||
| 158 | VALID_RGBLIGHT_TYPES := WS2812 APA102 custom | ||
| 159 | |||
| 160 | ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes) | ||
| 161 | RGBLIGHT_DRIVER ?= custom | ||
| 162 | endif | ||
| 163 | |||
| 157 | ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) | 164 | ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) |
| 158 | POST_CONFIG_H += $(QUANTUM_DIR)/rgblight_post_config.h | 165 | RGBLIGHT_DRIVER ?= WS2812 |
| 159 | OPT_DEFS += -DRGBLIGHT_ENABLE | 166 | |
| 160 | SRC += $(QUANTUM_DIR)/color.c | 167 | ifeq ($(filter $(RGBLIGHT_DRIVER),$(VALID_RGBLIGHT_TYPES)),) |
| 161 | SRC += $(QUANTUM_DIR)/rgblight.c | 168 | $(error RGBLIGHT_DRIVER="$(RGBLIGHT_DRIVER)" is not a valid RGB type) |
| 162 | CIE1931_CURVE := yes | ||
| 163 | RGB_KEYCODES_ENABLE := yes | ||
| 164 | ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes) | ||
| 165 | OPT_DEFS += -DRGBLIGHT_CUSTOM_DRIVER | ||
| 166 | else | 169 | else |
| 170 | POST_CONFIG_H += $(QUANTUM_DIR)/rgblight_post_config.h | ||
| 171 | OPT_DEFS += -DRGBLIGHT_ENABLE | ||
| 172 | SRC += $(QUANTUM_DIR)/color.c | ||
| 173 | SRC += $(QUANTUM_DIR)/rgblight.c | ||
| 174 | CIE1931_CURVE := yes | ||
| 175 | RGB_KEYCODES_ENABLE := yes | ||
| 176 | endif | ||
| 177 | |||
| 178 | ifeq ($(strip $(RGBLIGHT_DRIVER)), WS2812) | ||
| 167 | WS2812_DRIVER_REQUIRED := yes | 179 | WS2812_DRIVER_REQUIRED := yes |
| 168 | endif | 180 | endif |
| 181 | |||
| 182 | ifeq ($(strip $(RGBLIGHT_DRIVER)), APA102) | ||
| 183 | APA102_DRIVER_REQUIRED := yes | ||
| 184 | endif | ||
| 185 | |||
| 186 | ifeq ($(strip $(RGBLIGHT_DRIVER)), custom) | ||
| 187 | OPT_DEFS += -DRGBLIGHT_CUSTOM_DRIVER | ||
| 188 | endif | ||
| 169 | endif | 189 | endif |
| 170 | 190 | ||
| 171 | 191 | ||
| @@ -243,6 +263,11 @@ endif | |||
| 243 | WS2812_DRIVER_REQUIRED := yes | 263 | WS2812_DRIVER_REQUIRED := yes |
| 244 | endif | 264 | endif |
| 245 | 265 | ||
| 266 | ifeq ($(strip $(RGB_MATRIX_DRIVER)), APA102) | ||
| 267 | OPT_DEFS += -DAPA102 | ||
| 268 | APA102_DRIVER_REQUIRED := yes | ||
| 269 | endif | ||
| 270 | |||
| 246 | ifeq ($(strip $(RGB_MATRIX_CUSTOM_KB)), yes) | 271 | ifeq ($(strip $(RGB_MATRIX_CUSTOM_KB)), yes) |
| 247 | OPT_DEFS += -DRGB_MATRIX_CUSTOM_KB | 272 | OPT_DEFS += -DRGB_MATRIX_CUSTOM_KB |
| 248 | endif | 273 | endif |
| @@ -345,6 +370,11 @@ ifeq ($(strip $(WS2812_DRIVER_REQUIRED)), yes) | |||
| 345 | endif | 370 | endif |
| 346 | endif | 371 | endif |
| 347 | 372 | ||
| 373 | ifeq ($(strip $(APA102_DRIVER_REQUIRED)), yes) | ||
| 374 | COMMON_VPATH += $(DRIVER_PATH)/apa102 | ||
| 375 | SRC += apa102.c | ||
| 376 | endif | ||
| 377 | |||
| 348 | ifeq ($(strip $(VISUALIZER_ENABLE)), yes) | 378 | ifeq ($(strip $(VISUALIZER_ENABLE)), yes) |
| 349 | CIE1931_CURVE := yes | 379 | CIE1931_CURVE := yes |
| 350 | endif | 380 | endif |
