summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-04-11 13:16:54 +1000
committerDamien George <damien.p.george@gmail.com>2018-04-11 13:16:54 +1000
commitde9528d12c73d658406d1b11ff44d7a39596af01 (patch)
tree66721856a48a138bd0b101b8dd54d183375b655b
parent59dda7103855e2f85822f83ecbb835d66f12183d (diff)
stm32/adc: Fix verification of ADC channel 16 for F411 MCUs.
-rw-r--r--ports/stm32/adc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ports/stm32/adc.c b/ports/stm32/adc.c
index 3f38fa2ca..3f00ad875 100644
--- a/ports/stm32/adc.c
+++ b/ports/stm32/adc.c
@@ -137,7 +137,10 @@ static inline uint32_t adc_get_internal_channel(uint32_t channel) {
}
STATIC bool is_adcx_channel(int channel) {
-#if defined(STM32F4) || defined(STM32F7)
+#if defined(STM32F411xE)
+ // The HAL has an incorrect IS_ADC_CHANNEL macro for the F411 so we check for temp
+ return IS_ADC_CHANNEL(channel) || channel == ADC_CHANNEL_TEMPSENSOR;
+#elif defined(STM32F4) || defined(STM32F7)
return IS_ADC_CHANNEL(channel);
#elif defined(STM32L4)
ADC_HandleTypeDef handle;