Skip to content

Commit d0fce35

Browse files
committed
STM32F4: Set ADC sample time to max value for VRefInt
1 parent 99a8467 commit d0fce35

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

targets/TARGET_STM/TARGET_STM32F4/analogin_api.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,12 @@ static inline uint16_t adc_read(analogin_t *obj)
180180
break;
181181
case 17:
182182
sConfig.Channel = ADC_CHANNEL_VREFINT;
183+
/* From experiment, measurement needs max sampling time to be valid */
184+
sConfig.SamplingTime = ADC_SAMPLETIME_480CYCLES;
183185
break;
184186
case 18:
185187
sConfig.Channel = ADC_CHANNEL_VBAT;
186-
/* From experiment, VBAT measurement needs max
187-
* sampling time to be avlid */
188+
/* From experiment, measurement needs max sampling time to be valid */
188189
sConfig.SamplingTime = ADC_SAMPLETIME_480CYCLES;
189190
break;
190191
default:

0 commit comments

Comments
 (0)