From e884e42ce98ad8994477deef26e6ad27b8b3643c Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sun, 12 Nov 2023 22:30:27 +0000 Subject: Generalise ADC driver source inclusion (#22448) --- builddefs/common_features.mk | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'builddefs') diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk index b6f888d30d..fbaf087ad1 100644 --- a/builddefs/common_features.mk +++ b/builddefs/common_features.mk @@ -139,8 +139,7 @@ ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes) ifeq ($(strip $(POINTING_DEVICE_DRIVER)), adns9800) SPI_DRIVER_REQUIRED = yes else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), analog_joystick) - OPT_DEFS += -DSTM32_ADC -DHAL_USE_ADC=TRUE - LIB_SRC += analog.c + ANALOG_DRIVER_REQUIRED = yes else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), cirque_pinnacle_i2c) I2C_DRIVER_REQUIRED = yes SRC += drivers/sensors/cirque_pinnacle.c @@ -840,8 +839,8 @@ ifeq ($(strip $(JOYSTICK_ENABLE)), yes) SRC += $(QUANTUM_DIR)/joystick.c ifeq ($(strip $(JOYSTICK_DRIVER)), analog) + ANALOG_DRIVER_REQUIRED = yes OPT_DEFS += -DANALOG_JOYSTICK_ENABLE - SRC += analog.c endif ifeq ($(strip $(JOYSTICK_DRIVER)), digital) OPT_DEFS += -DDIGITAL_JOYSTICK_ENABLE @@ -886,9 +885,9 @@ ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) ifeq ($(strip $(BLUETOOTH_DRIVER)), bluefruit_le) SPI_DRIVER_REQUIRED = yes + ANALOG_DRIVER_REQUIRED = yes SRC += $(DRIVER_PATH)/bluetooth/bluetooth.c SRC += $(DRIVER_PATH)/bluetooth/bluefruit_le.cpp - QUANTUM_LIB_SRC += analog.c endif ifeq ($(strip $(BLUETOOTH_DRIVER)), rn42) @@ -935,6 +934,11 @@ ifeq ($(strip $(APA102_DRIVER_REQUIRED)), yes) SRC += apa102.c endif +ifeq ($(strip $(ANALOG_DRIVER_REQUIRED)), yes) + OPT_DEFS += -DHAL_USE_ADC=TRUE + QUANTUM_LIB_SRC += analog.c +endif + ifeq ($(strip $(I2C_DRIVER_REQUIRED)), yes) OPT_DEFS += -DHAL_USE_I2C=TRUE QUANTUM_LIB_SRC += i2c_master.c -- cgit v1.2.3