summaryrefslogtreecommitdiff
path: root/builddefs
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2023-11-12 22:30:27 +0000
committerGitHub <noreply@github.com>2023-11-12 22:30:27 +0000
commite884e42ce98ad8994477deef26e6ad27b8b3643c (patch)
tree8e897e11952d488f8fc439db5b5aa7c5342faa9d /builddefs
parent786ebf87608dd4d7232cd0e66638382a55ceafa4 (diff)
Generalise ADC driver source inclusion (#22448)
Diffstat (limited to 'builddefs')
-rw-r--r--builddefs/common_features.mk12
1 files changed, 8 insertions, 4 deletions
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