We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1eca6b7 commit 747e5d2Copy full SHA for 747e5d2
libraries/SrcWrapper/src/stm32/analog.cpp
@@ -46,6 +46,10 @@ static PinName g_current_pin = NC;
46
#endif
47
#endif /* !ADC_SAMPLINGTIME */
48
49
+#if defined(ADC_VER_V5_V90) && !defined(ADC3_SAMPLINGTIME)
50
+#define ADC3_SAMPLINGTIME ADC3_SAMPLETIME_24CYCLES_5;
51
+#endif
52
+
53
/*
54
* Minimum ADC sampling time is required when reading
55
* internal channels so set it to max possible value.
@@ -770,6 +774,11 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
770
774
} else {
771
775
AdcHandle.Instance = (ADC_TypeDef *)pinmap_peripheral(pin, PinMap_ADC);
772
776
channel = get_adc_channel(pin, &bank);
777
+#if defined(ADC_VER_V5_V90)
778
+ if (AdcHandle.Instance == ADC3) {
779
+ samplingTime = ADC3_SAMPLINGTIME;
780
+ }
781
773
782
}
783
784
if (AdcHandle.Instance == NP) {
0 commit comments