From ee34fe7519dcb8332a8278133e263764b033149b Mon Sep 17 00:00:00 2001 From: OceanSkyFly Date: Tue, 13 May 2025 15:43:30 +0800 Subject: [PATCH] fix nrf51 voltage refresh fix the problem that the voltage will not update until a full restart --- EPD/EPD_driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/EPD/EPD_driver.c b/EPD/EPD_driver.c index 656c748..69682a4 100644 --- a/EPD/EPD_driver.c +++ b/EPD/EPD_driver.c @@ -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;