From 33a9b3e62bbcdb845eba5df28b86e7a566dd5cf4 Mon Sep 17 00:00:00 2001 From: Tomas Cerskus Date: Thu, 8 Feb 2018 17:06:10 +0000 Subject: [PATCH] [efr32] fix otPlatRadioTxDone sometimes not being called (#2549) Sometimes when transmission is started RAIL_EVENT_RX_OVERFLOW happens and then otPlatRadioTxDone is never called. This commit makes sure the RX FIFO is always drained, even when transmitting so RAIL_EVENT_RX_OVERFLOW never happens. --- examples/platforms/efr32/radio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/platforms/efr32/radio.c b/examples/platforms/efr32/radio.c index 778dc2f30..0f977165f 100644 --- a/examples/platforms/efr32/radio.c +++ b/examples/platforms/efr32/radio.c @@ -657,8 +657,6 @@ static void processNextRxPacket(otInstance *aInstance, RAIL_Handle_t aRailHandle RAIL_Status_t status; uint16_t length; - otEXPECT(sState == OT_RADIO_STATE_RECEIVE); - packetHandle = RAIL_GetRxPacketInfo(aRailHandle, RAIL_RX_PACKET_HANDLE_OLDEST, &packetInfo); otEXPECT_ACTION(packetInfo.packetStatus == RAIL_RX_PACKET_READY_SUCCESS, packetHandle = RAIL_RX_PACKET_HANDLE_INVALID); @@ -666,6 +664,7 @@ static void processNextRxPacket(otInstance *aInstance, RAIL_Handle_t aRailHandle packetDetails.timeReceived.timePosition = RAIL_PACKET_TIME_INVALID; packetDetails.timeReceived.totalPacketBytes = 0; status = RAIL_GetRxPacketDetails(aRailHandle, packetHandle, &packetDetails); + otEXPECT(status != RAIL_STATUS_INVALID_STATE); assert(status == RAIL_STATUS_NO_ERROR); length = packetInfo.packetBytes + 1;