aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32/adc.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2021-10-06 19:48:03 -0400
committerKevin O'Connor <kevin@koconnor.net>2021-10-06 19:56:46 -0400
commite3905eb2419b4d7bc8200a87e1dcac5c6eba9064 (patch)
tree677038e1fc54d91dd57368b01d2afb92f3c579a2 /src/stm32/adc.c
parentc1136bef10f43b2c69400af38c4404e2d20e9180 (diff)
downloadkutter-e3905eb2419b4d7bc8200a87e1dcac5c6eba9064.tar.gz
kutter-e3905eb2419b4d7bc8200a87e1dcac5c6eba9064.tar.xz
kutter-e3905eb2419b4d7bc8200a87e1dcac5c6eba9064.zip
stm32: Add an MACH_STM32F4x5 alias for F405, F407, and F429 chips
The F405, F407, and F429 chips are in the same series and almost all code definitions should apply to all chips in that series. Implement the alias and fix defintions in adc.c and Kconfig that were only applying to a subset of that series. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32/adc.c')
-rw-r--r--src/stm32/adc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/stm32/adc.c b/src/stm32/adc.c
index 93a5309c..02e54fba 100644
--- a/src/stm32/adc.c
+++ b/src/stm32/adc.c
@@ -26,13 +26,13 @@ static const uint8_t adc_pins[] = {
#if CONFIG_MACH_STM32F1
ADC_TEMPERATURE_PIN,
-#elif CONFIG_MACH_STM32F2 || CONFIG_MACH_STM32F405 || CONFIG_MACH_STM32F407
+#elif CONFIG_MACH_STM32F2 || CONFIG_MACH_STM32F4x5
ADC_TEMPERATURE_PIN, 0x00, 0x00,
#elif CONFIG_MACH_STM32F446
0x00, 0x00, ADC_TEMPERATURE_PIN,
#endif
-#if CONFIG_MACH_STM32F405 || CONFIG_MACH_STM32F407 || CONFIG_MACH_STM32F446
+#if CONFIG_MACH_STM32F4x5 || CONFIG_MACH_STM32F446
0x00, 0x00, 0x00, 0x00,
GPIO('F', 6), GPIO('F', 7), GPIO('F', 8), GPIO('F', 9),
GPIO('F', 10), GPIO('F', 3), 0x00, 0x00,
@@ -83,7 +83,7 @@ gpio_adc_setup(uint32_t pin)
// Determine which ADC block to use
ADC_TypeDef *adc = ADC1;
uint32_t adc_base = ADC1_BASE;
-#if CONFIG_MACH_STM32F405 || CONFIG_MACH_STM32F407 || CONFIG_MACH_STM32F446
+#if CONFIG_MACH_STM32F4x5 || CONFIG_MACH_STM32F446
if (chan >= 19) {
// On the STM32F4, some ADC channels are only available from ADC3
adc = ADC3;