[nrf52840] avoid unexpected transmit done callback after pseudo reset (#2862)

Introduce a nrf5RadioPseudoReset() method, it will put the radio to sleep mode,
and clear the pending events during pseudo reset. So to avoid unexpected transmit
done callback after pseudo reset, which may cause the device to hang.
This commit is contained in:
Shu Chen
2018-07-09 11:05:45 -05:00
committed by Jonathan Hui
parent 19c73f8b66
commit cdc772759e
3 changed files with 13 additions and 0 deletions
@@ -148,6 +148,12 @@ void nrf5RadioInit(void);
*/
void nrf5RadioDeinit(void);
/**
* Pseudo reset Radio driver.
*
*/
void nrf5RadioPseudoReset(void);
/**
* Function for processing Radio.
*
+1
View File
@@ -55,6 +55,7 @@ void PlatformInit(int argc, char *argv[])
if (gPlatformPseudoResetWasRequested)
{
nrf5RadioPseudoReset();
nrf5AlarmDeinit();
nrf5AlarmInit();
+6
View File
@@ -227,6 +227,12 @@ void nrf5RadioDeinit(void)
nrf_802154_deinit();
}
void nrf5RadioPseudoReset(void)
{
nrf_802154_sleep();
sPendingEvents = 0;
}
otRadioState otPlatRadioGetState(otInstance *aInstance)
{
(void)aInstance;