diff --git a/src/stm32/adc.c b/src/stm32/adc.c index 02e54fba..39d4f643 100644 --- a/src/stm32/adc.c +++ b/src/stm32/adc.c @@ -28,7 +28,7 @@ static const uint8_t adc_pins[] = { ADC_TEMPERATURE_PIN, #elif CONFIG_MACH_STM32F2 || CONFIG_MACH_STM32F4x5 ADC_TEMPERATURE_PIN, 0x00, 0x00, -#elif CONFIG_MACH_STM32F446 +#elif CONFIG_MACH_STM32F401 || CONFIG_MACH_STM32F446 0x00, 0x00, ADC_TEMPERATURE_PIN, #endif @@ -108,7 +108,9 @@ gpio_adc_setup(uint32_t pin) } if (pin == ADC_TEMPERATURE_PIN) { -#if !(CONFIG_MACH_STM32F1 || CONFIG_MACH_STM32F401) +#if CONFIG_MACH_STM32F401 + ADC1_COMMON->CCR = ADC_CCR_TSVREFE; +#elif !CONFIG_MACH_STM32F1 ADC123_COMMON->CCR = ADC_CCR_TSVREFE; #endif } else {