diff options
Diffstat (limited to 'common_features.mk')
-rw-r--r-- | common_features.mk | 54 |
1 files changed, 49 insertions, 5 deletions
diff --git a/common_features.mk b/common_features.mk index f4f79000b3..6193597174 100644 --- a/common_features.mk +++ b/common_features.mk @@ -127,6 +127,12 @@ ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes) SRC += $(QUANTUM_DIR)/pointing_device.c endif +ifeq ($(strip $(PROGRAMMABLE_BUTTON_ENABLE)), yes) + OPT_DEFS += -DPROGRAMMABLE_BUTTON_ENABLE + SRC += $(QUANTUM_DIR)/programmable_button.c + SRC += $(QUANTUM_DIR)/process_keycode/process_programmable_button.c +endif + VALID_EEPROM_DRIVER_TYPES := vendor custom transient i2c spi EEPROM_DRIVER ?= vendor ifeq ($(filter $(EEPROM_DRIVER),$(VALID_EEPROM_DRIVER_TYPES)),) @@ -157,31 +163,45 @@ else # Automatically provided by avr-libc, nothing required else ifeq ($(PLATFORM),CHIBIOS) ifeq ($(MCU_SERIES), STM32F3xx) + OPT_DEFS += -DEEPROM_DRIVER + COMMON_VPATH += $(DRIVER_PATH)/eeprom + SRC += eeprom_driver.c SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c OPT_DEFS += -DEEPROM_EMU_STM32F303xC - OPT_DEFS += -DSTM32_EEPROM_ENABLE else ifeq ($(MCU_SERIES), STM32F1xx) + OPT_DEFS += -DEEPROM_DRIVER + COMMON_VPATH += $(DRIVER_PATH)/eeprom + SRC += eeprom_driver.c SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c OPT_DEFS += -DEEPROM_EMU_STM32F103xB - OPT_DEFS += -DSTM32_EEPROM_ENABLE else ifeq ($(MCU_SERIES)_$(MCU_LDSCRIPT), STM32F0xx_STM32F072xB) + OPT_DEFS += -DEEPROM_DRIVER + COMMON_VPATH += $(DRIVER_PATH)/eeprom + SRC += eeprom_driver.c SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c OPT_DEFS += -DEEPROM_EMU_STM32F072xB - OPT_DEFS += -DSTM32_EEPROM_ENABLE + else ifneq ($(filter $(MCU_SERIES)_$(MCU_LDSCRIPT),STM32F4xx_STM32F401xC STM32F4xx_STM32F411xE STM32F4xx_STM32F405xG),) + OPT_DEFS += -DEEPROM_DRIVER + COMMON_VPATH += $(DRIVER_PATH)/eeprom + SRC += eeprom_driver.c + SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c + SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c + OPT_DEFS += -DEEPROM_EMU_STM32F401xC else ifeq ($(MCU_SERIES)_$(MCU_LDSCRIPT), STM32F0xx_STM32F042x6) - # Stack sizes: Since this chip has limited RAM capacity, the stack area needs to be reduced. # This ensures that the EEPROM page buffer fits into RAM USE_PROCESS_STACKSIZE = 0x600 USE_EXCEPTIONS_STACKSIZE = 0x300 + OPT_DEFS += -DEEPROM_DRIVER + COMMON_VPATH += $(DRIVER_PATH)/eeprom + SRC += eeprom_driver.c SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c OPT_DEFS += -DEEPROM_EMU_STM32F042x6 - OPT_DEFS += -DSTM32_EEPROM_ENABLE else ifneq ($(filter $(MCU_SERIES),STM32L0xx STM32L1xx),) OPT_DEFS += -DEEPROM_DRIVER COMMON_VPATH += $(DRIVER_PATH)/eeprom @@ -745,3 +765,27 @@ ifeq ($(strip $(USBPD_ENABLE)), yes) endif endif endif + +BLUETOOTH_ENABLE ?= no +VALID_BLUETOOTH_DRIVER_TYPES := AdafruitBLE RN42 custom +ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) + ifeq ($(filter $(strip $(BLUETOOTH_DRIVER)),$(VALID_BLUETOOTH_DRIVER_TYPES)),) + $(error "$(BLUETOOTH_DRIVER)" is not a valid Bluetooth driver type) + endif + OPT_DEFS += -DBLUETOOTH_ENABLE + NO_USB_STARTUP_CHECK := yes + COMMON_VPATH += $(DRIVER_PATH)/bluetooth + SRC += outputselect.c + + ifeq ($(strip $(BLUETOOTH_DRIVER)), AdafruitBLE) + OPT_DEFS += -DMODULE_ADAFRUIT_BLE + SRC += analog.c + SRC += $(DRIVER_PATH)/bluetooth/adafruit_ble.cpp + QUANTUM_LIB_SRC += spi_master.c + endif + + ifeq ($(strip $(BLUETOOTH_DRIVER)), RN42) + OPT_DEFS += -DMODULE_RN42 + SRC += $(TMK_DIR)/protocol/serial_uart.c + endif +endif |