mirror of
https://github.com/espressif/openthread.git
synced 2026-07-31 16:17:47 +00:00
[nrf528xx] ensure there is no radio pending events after diag is disabled (#4343)
This commit is contained in:
committed by
Jonathan Hui
parent
205842d414
commit
4b422a33a0
@@ -415,6 +415,9 @@ void otPlatDiagModeSet(bool aMode)
|
||||
{
|
||||
otPlatRadioReceive(NULL, sChannel);
|
||||
otPlatRadioSleep(NULL);
|
||||
|
||||
// Clear all remaining events before switching to MAC callbacks.
|
||||
nrf5RadioClearPendingEvents();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -166,6 +166,12 @@ void nrf5RadioDeinit(void);
|
||||
*/
|
||||
void nrf5RadioProcess(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* Function for clearing Radio driver pending events.
|
||||
*
|
||||
*/
|
||||
void nrf5RadioClearPendingEvents(void);
|
||||
|
||||
/**
|
||||
* Initialization of hardware crypto engine.
|
||||
*
|
||||
|
||||
@@ -254,6 +254,21 @@ void nrf5RadioDeinit(void)
|
||||
sPendingEvents = 0;
|
||||
}
|
||||
|
||||
void nrf5RadioClearPendingEvents(void)
|
||||
{
|
||||
sPendingEvents = 0;
|
||||
|
||||
for (uint32_t i = 0; i < NRF_802154_RX_BUFFERS; i++)
|
||||
{
|
||||
if (sReceivedFrames[i].mPsdu != NULL)
|
||||
{
|
||||
uint8_t *bufferAddress = &sReceivedFrames[i].mPsdu[-1];
|
||||
sReceivedFrames[i].mPsdu = NULL;
|
||||
nrf_802154_buffer_free_raw(bufferAddress);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
otRadioState otPlatRadioGetState(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
Reference in New Issue
Block a user