mirror of
				https://github.com/mfulz/qmk_firmware.git
				synced 2025-10-31 05:12:33 +01:00 
			
		
		
		
	Generalise ADC driver source inclusion (#22448)
This commit is contained in:
		
							parent
							
								
									786ebf8760
								
							
						
					
					
						commit
						e884e42ce9
					
				| @ -139,8 +139,7 @@ ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes) | |||||||
|         ifeq ($(strip $(POINTING_DEVICE_DRIVER)), adns9800) |         ifeq ($(strip $(POINTING_DEVICE_DRIVER)), adns9800) | ||||||
|             SPI_DRIVER_REQUIRED = yes |             SPI_DRIVER_REQUIRED = yes | ||||||
|         else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), analog_joystick) |         else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), analog_joystick) | ||||||
|             OPT_DEFS += -DSTM32_ADC -DHAL_USE_ADC=TRUE |             ANALOG_DRIVER_REQUIRED = yes | ||||||
|             LIB_SRC += analog.c |  | ||||||
|         else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), cirque_pinnacle_i2c) |         else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), cirque_pinnacle_i2c) | ||||||
|             I2C_DRIVER_REQUIRED = yes |             I2C_DRIVER_REQUIRED = yes | ||||||
|             SRC += drivers/sensors/cirque_pinnacle.c |             SRC += drivers/sensors/cirque_pinnacle.c | ||||||
| @ -840,8 +839,8 @@ ifeq ($(strip $(JOYSTICK_ENABLE)), yes) | |||||||
|     SRC += $(QUANTUM_DIR)/joystick.c |     SRC += $(QUANTUM_DIR)/joystick.c | ||||||
| 
 | 
 | ||||||
|     ifeq ($(strip $(JOYSTICK_DRIVER)), analog) |     ifeq ($(strip $(JOYSTICK_DRIVER)), analog) | ||||||
|  |         ANALOG_DRIVER_REQUIRED = yes | ||||||
|         OPT_DEFS += -DANALOG_JOYSTICK_ENABLE |         OPT_DEFS += -DANALOG_JOYSTICK_ENABLE | ||||||
|         SRC += analog.c |  | ||||||
|     endif |     endif | ||||||
|     ifeq ($(strip $(JOYSTICK_DRIVER)), digital) |     ifeq ($(strip $(JOYSTICK_DRIVER)), digital) | ||||||
|         OPT_DEFS += -DDIGITAL_JOYSTICK_ENABLE |         OPT_DEFS += -DDIGITAL_JOYSTICK_ENABLE | ||||||
| @ -886,9 +885,9 @@ ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) | |||||||
| 
 | 
 | ||||||
|     ifeq ($(strip $(BLUETOOTH_DRIVER)), bluefruit_le) |     ifeq ($(strip $(BLUETOOTH_DRIVER)), bluefruit_le) | ||||||
|         SPI_DRIVER_REQUIRED = yes |         SPI_DRIVER_REQUIRED = yes | ||||||
|  |         ANALOG_DRIVER_REQUIRED = yes | ||||||
|         SRC += $(DRIVER_PATH)/bluetooth/bluetooth.c |         SRC += $(DRIVER_PATH)/bluetooth/bluetooth.c | ||||||
|         SRC += $(DRIVER_PATH)/bluetooth/bluefruit_le.cpp |         SRC += $(DRIVER_PATH)/bluetooth/bluefruit_le.cpp | ||||||
|         QUANTUM_LIB_SRC += analog.c |  | ||||||
|     endif |     endif | ||||||
| 
 | 
 | ||||||
|     ifeq ($(strip $(BLUETOOTH_DRIVER)), rn42) |     ifeq ($(strip $(BLUETOOTH_DRIVER)), rn42) | ||||||
| @ -935,6 +934,11 @@ ifeq ($(strip $(APA102_DRIVER_REQUIRED)), yes) | |||||||
|     SRC += apa102.c |     SRC += apa102.c | ||||||
| endif | 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) | ifeq ($(strip $(I2C_DRIVER_REQUIRED)), yes) | ||||||
|     OPT_DEFS += -DHAL_USE_I2C=TRUE |     OPT_DEFS += -DHAL_USE_I2C=TRUE | ||||||
|     QUANTUM_LIB_SRC += i2c_master.c |     QUANTUM_LIB_SRC += i2c_master.c | ||||||
|  | |||||||
| @ -9,7 +9,7 @@ This driver currently supports both AVR and a limited selection of ARM devices. | |||||||
| To use this driver, add the following to your `rules.mk`: | To use this driver, add the following to your `rules.mk`: | ||||||
| 
 | 
 | ||||||
| ```make | ```make | ||||||
| SRC += analog.c | ANALOG_DRIVER_REQUIRED = yes | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| Then place this include at the top of your code: | Then place this include at the top of your code: | ||||||
|  | |||||||
| @ -1 +1 @@ | |||||||
| SRC += analog.c | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
| @ -1,3 +1,4 @@ | |||||||
| CUSTOM_MATRIX = lite | CUSTOM_MATRIX = lite | ||||||
| QUANTUM_LIB_SRC += analog.c  |  | ||||||
| SRC += matrix.c ec_switch_matrix.c | SRC += matrix.c ec_switch_matrix.c | ||||||
|  | 
 | ||||||
|  | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
| @ -1,3 +1,4 @@ | |||||||
| CUSTOM_MATRIX = lite | CUSTOM_MATRIX = lite | ||||||
| QUANTUM_LIB_SRC += analog.c  |  | ||||||
| SRC += matrix.c ec_switch_matrix.c | SRC += matrix.c ec_switch_matrix.c | ||||||
|  | 
 | ||||||
|  | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
| @ -1,3 +1,4 @@ | |||||||
| CUSTOM_MATRIX = lite | CUSTOM_MATRIX = lite | ||||||
| QUANTUM_LIB_SRC += analog.c |  | ||||||
| SRC += matrix.c ec_switch_matrix.c | SRC += matrix.c ec_switch_matrix.c | ||||||
|  | 
 | ||||||
|  | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
| @ -1,3 +1,4 @@ | |||||||
| CUSTOM_MATRIX = lite | CUSTOM_MATRIX = lite | ||||||
| QUANTUM_LIB_SRC += analog.c |  | ||||||
| SRC += matrix.c ec_switch_matrix.c | SRC += matrix.c ec_switch_matrix.c | ||||||
|  | 
 | ||||||
|  | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
| @ -1,2 +1,4 @@ | |||||||
| CUSTOM_MATRIX = lite | CUSTOM_MATRIX = lite | ||||||
| SRC += analog.c matrix.c ec_switch_matrix.c | SRC += matrix.c ec_switch_matrix.c | ||||||
|  | 
 | ||||||
|  | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
| @ -1,3 +1,4 @@ | |||||||
| CUSTOM_MATRIX = lite | CUSTOM_MATRIX = lite | ||||||
| QUANTUM_LIB_SRC += analog.c  |  | ||||||
| SRC += matrix.c ec_switch_matrix.c | SRC += matrix.c ec_switch_matrix.c | ||||||
|  | 
 | ||||||
|  | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
| @ -1,3 +1,4 @@ | |||||||
| CUSTOM_MATRIX = lite | CUSTOM_MATRIX = lite | ||||||
| QUANTUM_LIB_SRC += analog.c  |  | ||||||
| SRC += matrix.c ec_switch_matrix.c | SRC += matrix.c ec_switch_matrix.c | ||||||
|  | 
 | ||||||
|  | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
| @ -1,3 +1,4 @@ | |||||||
| CUSTOM_MATRIX = lite | CUSTOM_MATRIX = lite | ||||||
| QUANTUM_LIB_SRC += analog.c |  | ||||||
| SRC += matrix.c ec_switch_matrix.c | SRC += matrix.c ec_switch_matrix.c | ||||||
|  | 
 | ||||||
|  | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
| @ -1,3 +1,4 @@ | |||||||
| CUSTOM_MATRIX = lite | CUSTOM_MATRIX = lite | ||||||
| QUANTUM_LIB_SRC += analog.c  |  | ||||||
| SRC += matrix.c ec_switch_matrix.c | SRC += matrix.c ec_switch_matrix.c | ||||||
|  | 
 | ||||||
|  | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
| @ -1,4 +1,6 @@ | |||||||
| UF2_DEVICE_TYPE_ID = 0x35446147 | UF2_DEVICE_TYPE_ID = 0x35446147 | ||||||
| UF2CONV_ARGS = --device-type $(UF2_DEVICE_TYPE_ID) | UF2CONV_ARGS = --device-type $(UF2_DEVICE_TYPE_ID) | ||||||
| 
 | 
 | ||||||
| SRC += analog.c lib/common.c lib/mux.c | SRC += lib/common.c lib/mux.c | ||||||
|  | 
 | ||||||
|  | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
| @ -1,4 +1,6 @@ | |||||||
| UF2_DEVICE_TYPE_ID = 0x27b9a6ea | UF2_DEVICE_TYPE_ID = 0x27b9a6ea | ||||||
| UF2CONV_ARGS = --device-type $(UF2_DEVICE_TYPE_ID) | UF2CONV_ARGS = --device-type $(UF2_DEVICE_TYPE_ID) | ||||||
| 
 | 
 | ||||||
| SRC += analog.c lib/common.c lib/mux.c | SRC += lib/common.c lib/mux.c | ||||||
|  | 
 | ||||||
|  | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
| @ -1,4 +1,6 @@ | |||||||
| UF2_DEVICE_TYPE_ID = 0x9bc1e968 | UF2_DEVICE_TYPE_ID = 0x9bc1e968 | ||||||
| UF2CONV_ARGS = --device-type $(UF2_DEVICE_TYPE_ID) | UF2CONV_ARGS = --device-type $(UF2_DEVICE_TYPE_ID) | ||||||
| 
 | 
 | ||||||
| SRC += analog.c lib/common.c lib/mux.c | SRC += lib/common.c lib/mux.c | ||||||
|  | 
 | ||||||
|  | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
| @ -18,5 +18,6 @@ RGB_MATRIX_ENABLE = yes | |||||||
| 
 | 
 | ||||||
| LTO_ENABLE = yes | LTO_ENABLE = yes | ||||||
| 
 | 
 | ||||||
| SRC += 	analog.c \
 | ANALOG_DRIVER_REQUIRED = yes | ||||||
| 		matrix.c | 
 | ||||||
|  | SRC += matrix.c | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| SRC += analog.c |  | ||||||
| 
 |  | ||||||
| # Build Options
 | # Build Options
 | ||||||
| #   change yes to no to disable
 | #   change yes to no to disable
 | ||||||
| #
 | #
 | ||||||
|  | |||||||
| @ -1,3 +1,3 @@ | |||||||
| SRC += analog.c |  | ||||||
| 
 |  | ||||||
| CONSOLE_ENABLE = yes | CONSOLE_ENABLE = yes | ||||||
|  | 
 | ||||||
|  | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
| @ -1 +0,0 @@ | |||||||
| SRC += analog.c |  | ||||||
| @ -18,10 +18,11 @@ PS2_ENABLE = yes | |||||||
| PS2_DRIVER = interrupt | PS2_DRIVER = interrupt | ||||||
| CUSTOM_MATRIX = yes | CUSTOM_MATRIX = yes | ||||||
| BLUETOOTH_ENABLE = yes | BLUETOOTH_ENABLE = yes | ||||||
|  | 
 | ||||||
| WS2812_DRIVER_REQUIRED = yes | WS2812_DRIVER_REQUIRED = yes | ||||||
|  | ANALOG_DRIVER_REQUIRED = yes | ||||||
| 
 | 
 | ||||||
| SRC += rgbsps.c | SRC += rgbsps.c | ||||||
| SRC += analog.c |  | ||||||
| SRC += matrix.c | SRC += matrix.c | ||||||
| 
 | 
 | ||||||
| LTO_ENABLE = yes | LTO_ENABLE = yes | ||||||
|  | |||||||
| @ -13,4 +13,4 @@ MIDI_ENABLE = yes           # MIDI support | |||||||
| AUDIO_ENABLE = no           # Audio output | AUDIO_ENABLE = no           # Audio output | ||||||
| LTO_ENABLE = yes | LTO_ENABLE = yes | ||||||
| 
 | 
 | ||||||
| SRC += analog.c | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
| @ -5,5 +5,3 @@ JOYSTICK_DRIVER = analog | |||||||
| EXTRAKEY_ENABLE = yes | EXTRAKEY_ENABLE = yes | ||||||
| WPM_ENABLE = yes | WPM_ENABLE = yes | ||||||
| LTO_ENABLE = yes | LTO_ENABLE = yes | ||||||
| 
 |  | ||||||
| SRC += analog.c |  | ||||||
|  | |||||||
| @ -19,5 +19,6 @@ MOUSEKEY_ENABLE = yes       # Mouse keys | |||||||
| ENCODER_ENABLE := no | ENCODER_ENABLE := no | ||||||
| OPTS_DEF += -DENCODER_ENABLE | OPTS_DEF += -DENCODER_ENABLE | ||||||
| 
 | 
 | ||||||
| QUANTUM_LIB_SRC += analog.c | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | 
 | ||||||
| SRC += opt_encoder.c | SRC += opt_encoder.c | ||||||
|  | |||||||
| @ -19,7 +19,8 @@ MOUSEKEY_ENABLE = yes       # Mouse keys | |||||||
| ENCODER_ENABLE := no | ENCODER_ENABLE := no | ||||||
| OPTS_DEF += -DENCODER_ENABLE | OPTS_DEF += -DENCODER_ENABLE | ||||||
| 
 | 
 | ||||||
| QUANTUM_LIB_SRC += analog.c | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | 
 | ||||||
| SRC += opt_encoder.c | SRC += opt_encoder.c | ||||||
| 
 | 
 | ||||||
| DEFAULT_FOLDER = ploopyco/trackball/rev1_005 | DEFAULT_FOLDER = ploopyco/trackball/rev1_005 | ||||||
|  | |||||||
| @ -16,7 +16,8 @@ MOUSEKEY_ENABLE = yes        # Mouse keys | |||||||
| ENCODER_ENABLE := no | ENCODER_ENABLE := no | ||||||
| OPTS_DEF += -DENCODER_ENABLE | OPTS_DEF += -DENCODER_ENABLE | ||||||
| 
 | 
 | ||||||
| QUANTUM_LIB_SRC += analog.c | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | 
 | ||||||
| SRC += opt_encoder.c | SRC += opt_encoder.c | ||||||
| 
 | 
 | ||||||
| DEFAULT_FOLDER = ploopyco/trackball_mini/rev1_001 | DEFAULT_FOLDER = ploopyco/trackball_mini/rev1_001 | ||||||
|  | |||||||
| @ -3,7 +3,8 @@ F_CPU = 8000000 | |||||||
| 
 | 
 | ||||||
| POINTING_DEVICE_DRIVER = pmw3360 | POINTING_DEVICE_DRIVER = pmw3360 | ||||||
| 
 | 
 | ||||||
| QUANTUM_LIB_SRC += analog.c | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | 
 | ||||||
| SRC += opt_encoder.c | SRC += opt_encoder.c | ||||||
| 
 | 
 | ||||||
| DEFAULT_FOLDER = ploopyco/trackball_thumb/rev1_001 | DEFAULT_FOLDER = ploopyco/trackball_thumb/rev1_001 | ||||||
|  | |||||||
| @ -13,4 +13,6 @@ AUDIO_ENABLE = no           # Audio output | |||||||
| CUSTOM_MATRIX = lite | CUSTOM_MATRIX = lite | ||||||
| SPLIT_KEYBOARD = yes | SPLIT_KEYBOARD = yes | ||||||
| 
 | 
 | ||||||
| SRC += analog.c ec_switch_matrix.c matrix.c | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | 
 | ||||||
|  | SRC += ec_switch_matrix.c matrix.c | ||||||
|  | |||||||
| @ -14,9 +14,9 @@ ifeq ($(strip $(OLED_ENABLE)), yes) | |||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
| ifeq ($(strip $(THUMBSTICK_ENABLE)), yes) | ifeq ($(strip $(THUMBSTICK_ENABLE)), yes) | ||||||
|  |     ANALOG_DRIVER_REQUIRED = yes | ||||||
|     POINTING_DEVICE_ENABLE = yes |     POINTING_DEVICE_ENABLE = yes | ||||||
|     POINTING_DEVICE_DRIVER = custom |     POINTING_DEVICE_DRIVER = custom | ||||||
|     OPT_DEFS += -DTHUMBSTICK_ENABLE |     OPT_DEFS += -DTHUMBSTICK_ENABLE | ||||||
| 	SRC += analog.c |  | ||||||
| 	SRC += thumbstick.c | 	SRC += thumbstick.c | ||||||
| endif | endif | ||||||
|  | |||||||
| @ -3,4 +3,4 @@ QUANTUM_PAINTER_DRIVERS = ssd1351_spi | |||||||
| 
 | 
 | ||||||
| DEFAULT_FOLDER = tzarc/ghoul/rev1/stm32 | DEFAULT_FOLDER = tzarc/ghoul/rev1/stm32 | ||||||
| 
 | 
 | ||||||
| SRC += analog.c | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
| @ -19,4 +19,4 @@ MAGIC_ENABLE = no | |||||||
| GRAVE_ESC_ENABLE = no | GRAVE_ESC_ENABLE = no | ||||||
| LTO_ENABLE = yes | LTO_ENABLE = yes | ||||||
| 
 | 
 | ||||||
| SRC += analog.c | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
| @ -11,5 +11,4 @@ BACKLIGHT_ENABLE = no       # Enable keyboard backlight functionality | |||||||
| RGBLIGHT_ENABLE = no        # Enable keyboard RGB underglow | RGBLIGHT_ENABLE = no        # Enable keyboard RGB underglow | ||||||
| AUDIO_ENABLE = no           # Audio output | AUDIO_ENABLE = no           # Audio output | ||||||
| 
 | 
 | ||||||
| SRC += analog.c | ANALOG_DRIVER_REQUIRED = yes | ||||||
| 
 |  | ||||||
|  | |||||||
| @ -1,3 +1,4 @@ | |||||||
| CUSTOM_MATRIX = lite | CUSTOM_MATRIX = lite | ||||||
| QUANTUM_LIB_SRC += analog.c |  | ||||||
| SRC += ec.c | SRC += ec.c | ||||||
|  | 
 | ||||||
|  | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
| @ -1,3 +1,4 @@ | |||||||
| CUSTOM_MATRIX = lite | CUSTOM_MATRIX = lite | ||||||
| QUANTUM_LIB_SRC += analog.c |  | ||||||
| SRC += ec.c | SRC += ec.c | ||||||
|  | 
 | ||||||
|  | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
| @ -1,3 +1,4 @@ | |||||||
| CUSTOM_MATRIX = lite | CUSTOM_MATRIX = lite | ||||||
| QUANTUM_LIB_SRC += analog.c |  | ||||||
| SRC += ec.c | SRC += ec.c | ||||||
|  | 
 | ||||||
|  | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
| @ -1,3 +1,4 @@ | |||||||
| CUSTOM_MATRIX = lite | CUSTOM_MATRIX = lite | ||||||
| QUANTUM_LIB_SRC += analog.c |  | ||||||
| SRC += ec.c | SRC += ec.c | ||||||
|  | 
 | ||||||
|  | ANALOG_DRIVER_REQUIRED = yes | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Joel Challis
						Joel Challis