aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2025-04-09 12:52:11 -0400
committerKevin O'Connor <kevin@koconnor.net>2025-04-16 13:54:44 -0400
commit8c67adc164d15d898b90fce6351190399f86d6f3 (patch)
tree74ba9ff80e4df242e5761d66c6dad0b98aee8c52 /src/stm32
parent04e7eb20fd9b65addcbb4773fdb7b6be9dbf6195 (diff)
downloadkutter-8c67adc164d15d898b90fce6351190399f86d6f3.tar.gz
kutter-8c67adc164d15d898b90fce6351190399f86d6f3.tar.xz
kutter-8c67adc164d15d898b90fce6351190399f86d6f3.zip
Kconfig: Add new WANT_ADC option to reduce code size
Make it possible to not compile in support for ADC on chips with small flash sizes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32')
-rw-r--r--src/stm32/Makefile23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/stm32/Makefile b/src/stm32/Makefile
index 39e206bd..6b0505a5 100644
--- a/src/stm32/Makefile
+++ b/src/stm32/Makefile
@@ -43,34 +43,37 @@ src-y += generic/armcm_boot.c generic/armcm_irq.c generic/armcm_reset.c
src-$(CONFIG_MACH_STM32F0) += ../lib/stm32f0/system_stm32f0xx.c
src-$(CONFIG_MACH_STM32F0) += generic/timer_irq.c stm32/stm32f0_timer.c
src-$(CONFIG_MACH_STM32F0) += stm32/stm32f0.c stm32/gpioperiph.c
-src-$(CONFIG_MACH_STM32F0) += stm32/stm32f0_adc.c
src-$(CONFIG_MACH_STM32F103) += ../lib/stm32f1/system_stm32f1xx.c
-src-$(CONFIG_MACH_STM32F103) += stm32/adc.c
src-$(CONFIG_MACH_N32G45x) += ../lib/stm32f1/system_stm32f1xx.c
-src-$(CONFIG_MACH_N32G45x) += ../lib/n32g45x/n32g45x_adc.c stm32/n32g45x_adc.c
src-$(CONFIG_MACH_STM32F1) += stm32/stm32f1.c generic/armcm_timer.c
src-$(CONFIG_MACH_STM32F2) += ../lib/stm32f2/system_stm32f2xx.c
src-$(CONFIG_MACH_STM32F2) += stm32/stm32f4.c generic/armcm_timer.c
-src-$(CONFIG_MACH_STM32F2) += stm32/gpioperiph.c stm32/adc.c
+src-$(CONFIG_MACH_STM32F2) += stm32/gpioperiph.c
src-$(CONFIG_MACH_STM32F4) += ../lib/stm32f4/system_stm32f4xx.c
src-$(CONFIG_MACH_STM32F4) += stm32/stm32f4.c generic/armcm_timer.c
-src-$(CONFIG_MACH_STM32F4) += stm32/gpioperiph.c stm32/adc.c
+src-$(CONFIG_MACH_STM32F4) += stm32/gpioperiph.c
src-$(CONFIG_MACH_STM32F7) += ../lib/stm32f7/system_stm32f7xx.c
src-$(CONFIG_MACH_STM32F7) += stm32/stm32f7.c generic/armcm_timer.c
-src-$(CONFIG_MACH_STM32F7) += stm32/gpioperiph.c stm32/adc.c
+src-$(CONFIG_MACH_STM32F7) += stm32/gpioperiph.c
src-$(CONFIG_MACH_STM32G0) += generic/timer_irq.c stm32/stm32f0_timer.c
src-$(CONFIG_MACH_STM32G0) += stm32/stm32g0.c stm32/gpioperiph.c
-src-$(CONFIG_MACH_STM32G0) += stm32/stm32f0_adc.c
src-$(CONFIG_MACH_STM32G4) += ../lib/stm32g4/system_stm32g4xx.c
src-$(CONFIG_MACH_STM32G4) += stm32/stm32g4.c generic/armcm_timer.c
-src-$(CONFIG_MACH_STM32G4) += stm32/gpioperiph.c stm32/stm32h7_adc.c
+src-$(CONFIG_MACH_STM32G4) += stm32/gpioperiph.c
src-$(CONFIG_MACH_STM32H7) += ../lib/stm32h7/system_stm32h7xx.c
src-$(CONFIG_MACH_STM32H7) += stm32/stm32h7.c generic/armcm_timer.c
-src-$(CONFIG_MACH_STM32H7) += stm32/gpioperiph.c stm32/stm32h7_adc.c
+src-$(CONFIG_MACH_STM32H7) += stm32/gpioperiph.c
src-$(CONFIG_MACH_STM32L4) += ../lib/stm32l4/system_stm32l4xx.c
src-$(CONFIG_MACH_STM32L4) += stm32/stm32l4.c generic/armcm_timer.c
src-$(CONFIG_MACH_STM32L4) += stm32/gpioperiph.c
-src-$(CONFIG_MACH_STM32L4) += stm32/stm32h7_adc.c
+adc-src-y := stm32/adc.c
+adc-src-$(CONFIG_MACH_STM32F0) := stm32/stm32f0_adc.c
+adc-src-$(CONFIG_MACH_N32G45x) := ../lib/n32g45x/n32g45x_adc.c stm32/n32g45x_adc.c
+adc-src-$(CONFIG_MACH_STM32G0) := stm32/stm32f0_adc.c
+adc-src-$(CONFIG_MACH_STM32G4) := stm32/stm32h7_adc.c
+adc-src-$(CONFIG_MACH_STM32H7) := stm32/stm32h7_adc.c
+adc-src-$(CONFIG_MACH_STM32L4) := stm32/stm32h7_adc.c
+src-$(CONFIG_WANT_ADC) += $(adc-src-y)
spi-src-y := stm32/spi.c
spi-src-$(CONFIG_MACH_STM32H7) := stm32/stm32h7_spi.c
src-$(CONFIG_WANT_SPI) += $(spi-src-y)