Skip to content

Commit f51bbe0

Browse files
authored
Merge pull request #11471 from jeromecoutant/PR_WB_ADC
STM32WB ADC : consecutive VBAT reading
2 parents 9673ac1 + ee8489f commit f51bbe0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

targets/TARGET_STM/TARGET_STM32WB/analogin_device.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ uint16_t adc_read(analogin_t *obj)
194194
if (HAL_ADC_PollForConversion(&obj->handle, 10) == HAL_OK) {
195195
adcValue = (uint16_t)HAL_ADC_GetValue(&obj->handle);
196196
}
197+
198+
if (HAL_ADC_Stop(&obj->handle) != HAL_OK) {
199+
debug("HAL_ADC_Stop failed\r\n");
200+
}
201+
197202
LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE((&obj->handle)->Instance), LL_ADC_PATH_INTERNAL_NONE);
198203
return adcValue;
199204
}

0 commit comments

Comments
 (0)