fix nrf51 voltage refresh

fix the problem that the voltage will not update until a full restart
This commit is contained in:
OceanSkyFly
2025-05-13 15:43:30 +08:00
committed by Shuanglei Tao
parent 6dbc899bdd
commit ee34fe7519

View File

@@ -306,6 +306,7 @@ float EPD_ReadVoltage(void)
(ADC_CONFIG_EXTREFSEL_None << ADC_CONFIG_EXTREFSEL_Pos);
NRF_ADC->TASKS_START = 1;
while(!NRF_ADC->EVENTS_END);
NRF_ADC->EVENTS_END = 0;
uint16_t value = NRF_ADC->RESULT;
NRF_ADC->TASKS_STOP = 1;
NRF_ADC->ENABLE = 0;