Skip to content

Commit

Permalink
cp6
Browse files Browse the repository at this point in the history
  • Loading branch information
lmnotran committed Jan 19, 2024
1 parent 10ed6f2 commit 650a0b8
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/src/radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -338,7 +340,7 @@ static bool isMultiChannel(void)
{
firstChannel = sChannelSwitchingCfg.channels[i];
}
else
else if (firstChannel != sChannelSwitchingCfg.channels[i])
{
return true;
}
Expand Down Expand Up @@ -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]);
;
}
}
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 650a0b8

Please sign in to comment.