mirror of
https://github.com/tsl0922/EPD-nRF5.git
synced 2026-05-09 00:54:02 +08:00
fix nrf51 voltage refresh
fix the problem that the voltage will not update until a full restart
This commit is contained in:
committed by
Shuanglei Tao
parent
6dbc899bdd
commit
ee34fe7519
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user