replace wait() with nrf_delay_us()

master
Rohit Grover 2014-08-12 11:34:57 +01:00
parent 6086db38fd
commit 76f958494c
2 changed files with 6 additions and 5 deletions

View File

@ -19,6 +19,7 @@
#include "nrf_soc.h"
#include "btle/btle.h"
#include "nrf_delay.h"
/**
* The singleton which represents the nRF51822 transport for the BLEDevice.
@ -133,10 +134,10 @@ ble_error_t nRF51822n::init(void)
/**************************************************************************/
ble_error_t nRF51822n::reset(void)
{
wait(0.5);
nrf_delay_us(500000);
/* Wait for the radio to come back up */
wait(1);
nrf_delay_us(1000000);
return BLE_ERROR_NONE;
}

View File

@ -16,7 +16,7 @@
#include "nrf51_bitfields.h"
#include "nrf_soc.h"
#include "app_error.h"
//#include "nrf_delay.h"
#include "nrf_delay.h"
#include "mbed.h"
#include "app_util.h"
#include "app_util_platform.h"
@ -162,7 +162,7 @@ static void rtc1_start(void)
NVIC_EnableIRQ(RTC1_IRQn);
NRF_RTC1->TASKS_START = 1;
wait(0.0000001 * MAX_RTC_TASKS_DELAY);
nrf_delay_us(MAX_RTC_TASKS_DELAY / 10);
}
@ -176,7 +176,7 @@ static void rtc1_stop(void)
NRF_RTC1->INTENCLR = RTC_INTENSET_COMPARE0_Msk;
NRF_RTC1->TASKS_STOP = 1;
wait(0.0000001 * MAX_RTC_TASKS_DELAY);
nrf_delay_us(MAX_RTC_TASKS_DELAY / 10);
}