fix temperature sensor reading in nrf52dk platform, which was stuck at zero
This commit is contained in:
parent
4928a5e1e0
commit
cd1b23ff38
@ -64,7 +64,15 @@ static int
|
|||||||
value(int type)
|
value(int type)
|
||||||
{
|
{
|
||||||
#ifndef SOFTDEVICE_PRESENT
|
#ifndef SOFTDEVICE_PRESENT
|
||||||
return nrf_temp_read();
|
int32_t volatile temp;
|
||||||
|
|
||||||
|
NRF_TEMP->TASKS_START = 1;
|
||||||
|
while(NRF_TEMP->EVENTS_DATARDY == 0);
|
||||||
|
NRF_TEMP->EVENTS_DATARDY = 0;
|
||||||
|
temp = nrf_temp_read();
|
||||||
|
NRF_TEMP->TASKS_STOP = 1;
|
||||||
|
|
||||||
|
return temp;
|
||||||
#else
|
#else
|
||||||
int32_t temp;
|
int32_t temp;
|
||||||
sd_temp_get(&temp);
|
sd_temp_get(&temp);
|
||||||
|
Loading…
Reference in New Issue
Block a user