diff options
Diffstat (limited to 'common_features.mk')
-rw-r--r-- | common_features.mk | 52 |
1 files changed, 41 insertions, 11 deletions
diff --git a/common_features.mk b/common_features.mk index b9cd084d29..6365955a7f 100644 --- a/common_features.mk +++ b/common_features.mk @@ -135,7 +135,7 @@ else # This ensures that the EEPROM page buffer fits into RAM USE_PROCESS_STACKSIZE = 0x600 USE_EXCEPTIONS_STACKSIZE = 0x300 - + SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c OPT_DEFS += -DEEPROM_EMU_STM32F042x6 @@ -156,18 +156,38 @@ else endif endif +RGBLIGHT_ENABLE ?= no +VALID_RGBLIGHT_TYPES := WS2812 APA102 custom + +ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes) + RGBLIGHT_DRIVER ?= custom +endif + ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) - POST_CONFIG_H += $(QUANTUM_DIR)/rgblight_post_config.h - OPT_DEFS += -DRGBLIGHT_ENABLE - SRC += $(QUANTUM_DIR)/color.c - SRC += $(QUANTUM_DIR)/rgblight.c - CIE1931_CURVE := yes - RGB_KEYCODES_ENABLE := yes - ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes) - OPT_DEFS += -DRGBLIGHT_CUSTOM_DRIVER + RGBLIGHT_DRIVER ?= WS2812 + + ifeq ($(filter $(RGBLIGHT_DRIVER),$(VALID_RGBLIGHT_TYPES)),) + $(error RGBLIGHT_DRIVER="$(RGBLIGHT_DRIVER)" is not a valid RGB type) else + POST_CONFIG_H += $(QUANTUM_DIR)/rgblight_post_config.h + OPT_DEFS += -DRGBLIGHT_ENABLE + SRC += $(QUANTUM_DIR)/color.c + SRC += $(QUANTUM_DIR)/rgblight.c + CIE1931_CURVE := yes + RGB_KEYCODES_ENABLE := yes + endif + + ifeq ($(strip $(RGBLIGHT_DRIVER)), WS2812) WS2812_DRIVER_REQUIRED := yes endif + + ifeq ($(strip $(RGBLIGHT_DRIVER)), APA102) + APA102_DRIVER_REQUIRED := yes + endif + + ifeq ($(strip $(RGBLIGHT_DRIVER)), custom) + OPT_DEFS += -DRGBLIGHT_CUSTOM_DRIVER + endif endif @@ -202,7 +222,7 @@ ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) $(error "$(RGB_MATRIX_DRIVER)" is not a valid matrix type) endif OPT_DEFS += -DRGB_MATRIX_ENABLE -ifneq (,$(filter $(MCU), atmega16u2 atmega32u2)) +ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 at90usb162)) # ATmegaxxU2 does not have hardware MUL instruction - lib8tion must be told to use software multiplication routines OPT_DEFS += -DLIB8_ATTINY endif @@ -245,6 +265,11 @@ endif WS2812_DRIVER_REQUIRED := yes endif + ifeq ($(strip $(RGB_MATRIX_DRIVER)), APA102) + OPT_DEFS += -DAPA102 + APA102_DRIVER_REQUIRED := yes + endif + ifeq ($(strip $(RGB_MATRIX_CUSTOM_KB)), yes) OPT_DEFS += -DRGB_MATRIX_CUSTOM_KB endif @@ -347,6 +372,11 @@ ifeq ($(strip $(WS2812_DRIVER_REQUIRED)), yes) endif endif +ifeq ($(strip $(APA102_DRIVER_REQUIRED)), yes) + COMMON_VPATH += $(DRIVER_PATH)/apa102 + SRC += apa102.c +endif + ifeq ($(strip $(VISUALIZER_ENABLE)), yes) CIE1931_CURVE := yes endif @@ -453,7 +483,7 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes) # Determine which (if any) transport files are required ifneq ($(strip $(SPLIT_TRANSPORT)), custom) - QUANTUM_SRC += $(QUANTUM_DIR)/split_common/transport.c + QUANTUM_LIB_SRC += $(QUANTUM_DIR)/split_common/transport.c # Functions added via QUANTUM_LIB_SRC are only included in the final binary if they're called. # Unused functions are pruned away, which is why we can add multiple drivers here without bloat. ifeq ($(PLATFORM),AVR) |