mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #11471 from jeromecoutant/PR_WB_ADC
STM32WB ADC : consecutive VBAT readingpull/11514/head
commit
f51bbe01c8
|
@ -194,6 +194,11 @@ uint16_t adc_read(analogin_t *obj)
|
||||||
if (HAL_ADC_PollForConversion(&obj->handle, 10) == HAL_OK) {
|
if (HAL_ADC_PollForConversion(&obj->handle, 10) == HAL_OK) {
|
||||||
adcValue = (uint16_t)HAL_ADC_GetValue(&obj->handle);
|
adcValue = (uint16_t)HAL_ADC_GetValue(&obj->handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (HAL_ADC_Stop(&obj->handle) != HAL_OK) {
|
||||||
|
debug("HAL_ADC_Stop failed\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE((&obj->handle)->Instance), LL_ADC_PATH_INTERNAL_NONE);
|
LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE((&obj->handle)->Instance), LL_ADC_PATH_INTERNAL_NONE);
|
||||||
return adcValue;
|
return adcValue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue