@@ -139,8 +139,7 @@ ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes)
139139 ifeq ($(strip $(POINTING_DEVICE_DRIVER)), adns9800)
140140 SPI_DRIVER_REQUIRED = yes
141141 else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), analog_joystick)
142- OPT_DEFS += -DSTM32_ADC -DHAL_USE_ADC=TRUE
143- LIB_SRC += analog.c
142+ ANALOG_DRIVER_REQUIRED = yes
144143 else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), cirque_pinnacle_i2c)
145144 I2C_DRIVER_REQUIRED = yes
146145 SRC += drivers/sensors/cirque_pinnacle.c
@@ -840,8 +839,8 @@ ifeq ($(strip $(JOYSTICK_ENABLE)), yes)
840839 SRC += $(QUANTUM_DIR ) /joystick.c
841840
842841 ifeq ($(strip $(JOYSTICK_DRIVER)), analog)
842+ ANALOG_DRIVER_REQUIRED = yes
843843 OPT_DEFS += -DANALOG_JOYSTICK_ENABLE
844- SRC += analog.c
845844 endif
846845 ifeq ($(strip $(JOYSTICK_DRIVER)), digital)
847846 OPT_DEFS += -DDIGITAL_JOYSTICK_ENABLE
@@ -886,9 +885,9 @@ ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
886885
887886 ifeq ($(strip $(BLUETOOTH_DRIVER)), bluefruit_le)
888887 SPI_DRIVER_REQUIRED = yes
888+ ANALOG_DRIVER_REQUIRED = yes
889889 SRC += $(DRIVER_PATH ) /bluetooth/bluetooth.c
890890 SRC += $(DRIVER_PATH ) /bluetooth/bluefruit_le.cpp
891- QUANTUM_LIB_SRC += analog.c
892891 endif
893892
894893 ifeq ($(strip $(BLUETOOTH_DRIVER)), rn42)
@@ -935,6 +934,11 @@ ifeq ($(strip $(APA102_DRIVER_REQUIRED)), yes)
935934 SRC += apa102.c
936935endif
937936
937+ ifeq ($(strip $(ANALOG_DRIVER_REQUIRED ) ) , yes)
938+ OPT_DEFS += -DHAL_USE_ADC=TRUE
939+ QUANTUM_LIB_SRC += analog.c
940+ endif
941+
938942ifeq ($(strip $(I2C_DRIVER_REQUIRED ) ) , yes)
939943 OPT_DEFS += -DHAL_USE_I2C=TRUE
940944 QUANTUM_LIB_SRC += i2c_master.c
0 commit comments