[csl] fix the CSL RX window when not using RX AT mode (#7284) (#7296)

The RX window when not using RX AT mode is much larger than the
correct time and what is reported by the Open Thread log.

In the case of "receive at" we want the timer to fire before the next
RX window to program the exact RX activity in the radio and in the
other case, the timer will fire when the current RX window will end to
close the receiver and go to sleep.

This commit fixes the issue by increasing the sample time with the CSL
period before starting the timer in the case of RX AT and after in the
normal RX case.
This commit is contained in:
Marius Preda
2022-01-10 11:27:42 -08:00
committed by GitHub
parent 729780d3f6
commit 1c3a90f9f7
+2 -2
View File
@@ -1090,10 +1090,9 @@ void SubMac::HandleCslTimer(void)
break;
case kCslSleep:
mCslSampleTime += periodUs;
if (RadioSupportsReceiveTiming())
{
mCslSampleTime += periodUs;
mCslTimer.FireAt(mCslSampleTime - timeAhead);
timeAhead -= kCslReceiveTimeAhead;
}
@@ -1101,6 +1100,7 @@ void SubMac::HandleCslTimer(void)
{
mCslTimer.FireAt(mCslSampleTime + timeAfter);
mCslState = kCslSample;
mCslSampleTime += periodUs;
}
Get<Radio>().UpdateCslSampleTime(mCslSampleTime.GetValue());