mirror of
https://github.com/espressif/openthread.git
synced 2026-07-30 15:47:46 +00:00
[mac] stop timer before starting non-idle operation (#5921)
This commit is contained in:
@@ -845,6 +845,8 @@ void Mac::PerformNextOperation(void)
|
||||
if (mOperation != kOperationIdle)
|
||||
{
|
||||
otLogDebgMac("Starting operation \"%s\"", OperationToString(mOperation));
|
||||
mTimer.Stop(); // Stop the timer before any non-idle operation, have the operation itself be responsible to
|
||||
// start the timer (if it wants to).
|
||||
}
|
||||
|
||||
switch (mOperation)
|
||||
@@ -876,6 +878,7 @@ void Mac::PerformNextOperation(void)
|
||||
|
||||
case kOperationWaitingForData:
|
||||
IgnoreError(mSubMac.Receive(mRadioChannel));
|
||||
mTimer.Start(kDataPollTimeout);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1416,7 +1419,6 @@ void Mac::HandleTransmitDone(TxFrame &aFrame, RxFrame *aAckFrame, otError aError
|
||||
|
||||
if (IsEnabled() && framePending)
|
||||
{
|
||||
mTimer.Start(kDataPollTimeout);
|
||||
StartOperation(kOperationWaitingForData);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user