File tree 1 file changed +9
-0
lines changed
libraries/SrcWrapper/src/stm32
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ static PinName g_current_pin = NC;
46
46
#endif
47
47
#endif /* !ADC_SAMPLINGTIME */
48
48
49
+ #if defined(ADC_VER_V5_V90) && !defined(ADC3_SAMPLINGTIME)
50
+ #define ADC3_SAMPLINGTIME ADC3_SAMPLETIME_24CYCLES_5;
51
+ #endif
52
+
49
53
/*
50
54
* Minimum ADC sampling time is required when reading
51
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
+ #endif
773
782
}
774
783
775
784
if (AdcHandle.Instance == NP) {
You can’t perform that action at this time.
0 commit comments