// Subscribe for BLE events.
uint32_t err_code = softdevice_ble_evt_handler_set(ble_evt_dispatch);
APP_ERROR_CHECK(err_code);
}
void get_temperature(void)
{
NRF_TEMP->TASKS_START = 1; /**¿aê¼Î¶è2aá¿. */
/* Busy wait while temperature measurement is not finished, you can skip waiting if you enable interrupt for DATARDY event and read the result in the interrupt. */
/*lint -e{845} // A zero has been given as right argument to operator '|'" */
while (NRF_TEMP->EVENTS_DATARDY == 0)
{
// Do nothing.
}
NRF_TEMP->EVENTS_DATARDY = 0;
/**@note Workaround for PAN_028 rev2.0A anomaly 29 - TEMP: Stop task clears the TEMP register. */
temperature = (nrf_temp_read()/4);
temperature=temperature*0.6904-0.74;
/**@note Workaround for PAN_028 rev2.0A anomaly 30 - TEMP: Temp module analog front end does not power down when DATARDY event occurs. */
NRF_TEMP->TASKS_STOP = 1; /** Stop the temperature measurement. */