mirror of
https://github.com/espressif/openthread.git
synced 2026-08-06 02:37:47 +00:00
[link-raw] fix radio with multiple transmit buffers (#3239)
This commit is contained in:
@@ -244,4 +244,12 @@ void otSimSendEvent(const struct Event *aEvent);
|
||||
*/
|
||||
void otSimSendUartWriteEvent(const uint8_t *aData, uint16_t aLength);
|
||||
|
||||
/**
|
||||
* This function checks if radio transmitting is pending.
|
||||
*
|
||||
* @returns Whether radio transmitting is pending.
|
||||
*
|
||||
*/
|
||||
bool platformRadioIsTransmitPending(void);
|
||||
|
||||
#endif // PLATFORM_POSIX_H_
|
||||
|
||||
@@ -281,7 +281,7 @@ void otSysProcessDrivers(otInstance *aInstance)
|
||||
platformUartUpdateFdSet(&read_fds, &write_fds, &error_fds, &max_fd);
|
||||
#endif
|
||||
|
||||
if (!otTaskletsArePending(aInstance) && platformAlarmGetNext() > 0)
|
||||
if (!otTaskletsArePending(aInstance) && platformAlarmGetNext() > 0 && !platformRadioIsTransmitPending())
|
||||
{
|
||||
platformSendSleepEvent();
|
||||
|
||||
|
||||
@@ -540,9 +540,14 @@ void radioSendMessage(otInstance *aInstance)
|
||||
sAckWait = true;
|
||||
}
|
||||
|
||||
bool platformRadioIsTransmitPending(void)
|
||||
{
|
||||
return sState == OT_RADIO_STATE_TRANSMIT && !sAckWait;
|
||||
}
|
||||
|
||||
void platformRadioProcess(otInstance *aInstance)
|
||||
{
|
||||
if (sState == OT_RADIO_STATE_TRANSMIT && !sAckWait)
|
||||
if (platformRadioIsTransmitPending())
|
||||
{
|
||||
radioSendMessage(aInstance);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user