diff --git a/src/src/radio.c b/src/src/radio.c index f616db3e..4c78c33d 100644 --- a/src/src/radio.c +++ b/src/src/radio.c @@ -233,6 +233,8 @@ typedef struct uint8_t sReceivePsdu[IEEE802154_MAX_LENGTH]; } rxBuffer; +typedef uint8_t rxBufferIndex_t; + static volatile energyScanStatus sEnergyScanStatus; static volatile int8_t sEnergyScanResultDbm; static energyScanMode sEnergyScanMode; @@ -338,7 +340,7 @@ static bool isMultiChannel(void) { firstChannel = sChannelSwitchingCfg.channels[i]; } - else + else if (firstChannel != sChannelSwitchingCfg.channels[i]) { return true; } @@ -480,7 +482,6 @@ static void sli_get_default_and_max_powers_across_iids(int8_t *defaultTxPower, // We have already validated that sDefaultTxPower holds a valid value. *defaultTxPower = (*defaultTxPower == SL_INVALID_TX_POWER) ? sDefaultTxPower[iid] : SL_MAX(*defaultTxPower, sDefaultTxPower[iid]); - ; } } } @@ -1530,8 +1531,7 @@ otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel) int8_t txPower; OT_UNUSED_VARIABLE(aInstance); - - otEXPECT_ACTION((getInternalFlag(FLAG_ONGOING_TX_DATA) == 0) && sEnergyScanStatus != ENERGY_SCAN_STATUS_IN_PROGRESS, + otEXPECT_ACTION(!getInternalFlag(FLAG_ONGOING_TX_DATA) && sEnergyScanStatus != ENERGY_SCAN_STATUS_IN_PROGRESS, error = OT_ERROR_INVALID_STATE); #if FAST_CHANNEL_SWITCHING_SUPPORT @@ -1573,7 +1573,6 @@ otError otPlatRadioReceiveAt(otInstance *aInstance, uint8_t aChannel, uint32_t a otError error = OT_ERROR_NONE; RAIL_Status_t status; efr32BandConfig *config; - // uint8_t iid = otNcpPlatGetCurCommandIid(); int8_t txPower = sli_get_max_tx_power_across_iids(); OT_UNUSED_VARIABLE(aInstance); @@ -2520,7 +2519,7 @@ static void packetReceivedCallback(RAIL_RxPacketHandle_t packetHandle) { RAIL_RxPacketInfo_t packetInfo; RAIL_RxPacketDetails_t packetDetails; - uint16_t length; + uint16_t length = 0; bool framePendingInAck = false; bool rxCorrupted = false; uint8_t iid = 0; @@ -2558,7 +2557,7 @@ static void packetReceivedCallback(RAIL_RxPacketHandle_t packetHandle) #endif sReceiveAckFrame.mLength = length; - // Releasing the ACK frames here, ensures that the main thread (processNextRxPacket) + // Releasing the ACK frames here, ensures that the main thread (processRxPackets) // is not wasting cycles, releasing the ACK frames from the Rx FIFO queue. RAIL_ReleaseRxPacket(gRailHandle, packetHandle); @@ -3087,8 +3086,6 @@ static void updateRxFrameDetails(RAIL_RxPacketDetails_t *pPacketDetails, bool framePendingSetInOutgoingAck, uint8_t iid) { - OT_UNUSED_VARIABLE(iid); - OT_ASSERT(pPacketDetails != NULL); // Current time > sync-receive timestamp // Therefore lower 32 bits of current time should always be greater than lower 32 bits @@ -3112,7 +3109,7 @@ static void updateRxFrameDetails(RAIL_RxPacketDetails_t *pPacketDetails, pPacketDetails->timeReceived.packetTime + ((uint64_t)railUsTimerWraps << 32); // TODO: Maybe remove #if ? #if OPENTHREAD_RADIO && OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE == 1 - sReceiveAckFrame.mIid = iid; + sReceiveAckFrame.mIid = iid; #endif } else @@ -3126,7 +3123,7 @@ static void updateRxFrameDetails(RAIL_RxPacketDetails_t *pPacketDetails, // Set this flag only when the packet is really acknowledged with frame pending set. sReceiveFrame[sReceiveBufferInUse].mInfo.mRxInfo.mAckedWithFramePending = framePendingSetInOutgoingAck; #if OPENTHREAD_RADIO && OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE == 1 - sReceiveFrame.mIid = iid; + sReceiveFrame.mIid = iid; #endif #if OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2