Skip to content

Commit de9528d

Browse files
committed
stm32/adc: Fix verification of ADC channel 16 for F411 MCUs.
1 parent 59dda71 commit de9528d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

ports/stm32/adc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@ static inline uint32_t adc_get_internal_channel(uint32_t channel) {
137137
}
138138

139139
STATIC bool is_adcx_channel(int channel) {
140-
#if defined(STM32F4) || defined(STM32F7)
140+
#if defined(STM32F411xE)
141+
// The HAL has an incorrect IS_ADC_CHANNEL macro for the F411 so we check for temp
142+
return IS_ADC_CHANNEL(channel) || channel == ADC_CHANNEL_TEMPSENSOR;
143+
#elif defined(STM32F4) || defined(STM32F7)
141144
return IS_ADC_CHANNEL(channel);
142145
#elif defined(STM32L4)
143146
ADC_HandleTypeDef handle;

0 commit comments

Comments
 (0)