mirror of
https://github.com/espressif/openthread.git
synced 2026-08-06 10:47:46 +00:00
[low-power] fix csl simulation (#5785)
On nRF platform, otPlatRadioGetNow always gets the LSB part of an
uint64_t time. However, on simulation platform, this is not the
case. So in
if (otPlatRadioGetNow(&GetInstance()) <
mTransmitFrame.mInfo.mTxInfo.mTxDelayBaseTime +
mTransmitFrame.mInfo.mTxInfo.mTxDelay)
we don't get the result expected. otPlatRadioGetNow(&GetInstance()) is
a very big number on simulation platform, and mTxDelayBaseTime is the
LSB part of the rx time.
This commit is contained in:
@@ -356,8 +356,8 @@ void SubMac::StartCsmaBackoff(void)
|
||||
|
||||
if (ShouldHandleTransmitTargetTime())
|
||||
{
|
||||
if (otPlatRadioGetNow(&GetInstance()) <
|
||||
mTransmitFrame.mInfo.mTxInfo.mTxDelayBaseTime + mTransmitFrame.mInfo.mTxInfo.mTxDelay)
|
||||
if (Time(static_cast<uint32_t>(otPlatRadioGetNow(&GetInstance()))) <
|
||||
Time(mTransmitFrame.mInfo.mTxInfo.mTxDelayBaseTime) + mTransmitFrame.mInfo.mTxInfo.mTxDelay)
|
||||
{
|
||||
mTimer.StartAt(Time(mTransmitFrame.mInfo.mTxInfo.mTxDelayBaseTime),
|
||||
mTransmitFrame.mInfo.mTxInfo.mTxDelay);
|
||||
|
||||
Reference in New Issue
Block a user