mirror of
https://github.com/espressif/openthread.git
synced 2026-07-27 22:37:45 +00:00
[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:
@@ -148,6 +148,12 @@ void nrf5RadioInit(void);
|
||||
*/
|
||||
void nrf5RadioDeinit(void);
|
||||
|
||||
/**
|
||||
* Pseudo reset Radio driver.
|
||||
*
|
||||
*/
|
||||
void nrf5RadioPseudoReset(void);
|
||||
|
||||
/**
|
||||
* Function for processing Radio.
|
||||
*
|
||||
|
||||
@@ -55,6 +55,7 @@ void PlatformInit(int argc, char *argv[])
|
||||
|
||||
if (gPlatformPseudoResetWasRequested)
|
||||
{
|
||||
nrf5RadioPseudoReset();
|
||||
nrf5AlarmDeinit();
|
||||
nrf5AlarmInit();
|
||||
|
||||
|
||||
@@ -227,6 +227,12 @@ void nrf5RadioDeinit(void)
|
||||
nrf_802154_deinit();
|
||||
}
|
||||
|
||||
void nrf5RadioPseudoReset(void)
|
||||
{
|
||||
nrf_802154_sleep();
|
||||
sPendingEvents = 0;
|
||||
}
|
||||
|
||||
otRadioState otPlatRadioGetState(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
Reference in New Issue
Block a user