diff --git a/src/core/mac/sub_mac.hpp b/src/core/mac/sub_mac.hpp index dca05c4e8..395431ea4 100644 --- a/src/core/mac/sub_mac.hpp +++ b/src/core/mac/sub_mac.hpp @@ -632,7 +632,7 @@ private: void SetParams(uint16_t aPeriod, uint8_t aChannel, ShortAddress aShortAddr, const ExtAddress &aExtAddr); void ProcessTxDone(const TxFrame::ParseInfo &aFrameInfo, RxFrame *aAckFrame); void ProcessRxFrame(const RxFrame &aFrame); - void HandleTimer(void); + void HandleTimer(void) { ScheduleSampleWindow(); } const CslAccuracy &GetParentAccuracy(void) const { return mParentAccuracy; } void SetParentAccuracy(const CslAccuracy &aCslAccuracy) { mParentAccuracy = aCslAccuracy; } @@ -650,6 +650,7 @@ private: void RestartTimerAfterSyncUpdate(void); void SetLastSyncToNow(void); + void ScheduleSampleWindow(void); void DetermineWindow(const Radio::SyncedTime &aSampleTime, Window &aWindow) const; uint32_t DetermineClockDrift(uint32_t aIntervalUs) const; bool IsEnabled(void) const { return mPeriod > 0; } diff --git a/src/core/mac/sub_mac_csl_receiver.cpp b/src/core/mac/sub_mac_csl_receiver.cpp index b21a24fad..ab256cea3 100644 --- a/src/core/mac/sub_mac_csl_receiver.cpp +++ b/src/core/mac/sub_mac_csl_receiver.cpp @@ -72,12 +72,12 @@ void SubMac::CslReceiver::RestartTimerAfterSyncUpdate(void) mTimer.Stop(); - // Rewind sample times by one period. HandleTimer() will add this - // period back, effectively re-evaluating the current CSL period's + // Rewind sample times by one period. `ScheduleSampleWindow()` will add + // this period back, effectively re-evaluating the current CSL period's // schedule using the updated mLastSync. mSampleTime -= periodUs; - HandleTimer(); + ScheduleSampleWindow(); } } @@ -146,7 +146,7 @@ void SubMac::CslReceiver::SetParams(uint16_t aPeriod, #else mLastSync = mSampleTime.GetAsTime64(); #endif - HandleTimer(); + ScheduleSampleWindow(); } else { @@ -157,7 +157,7 @@ exit: return; } -void SubMac::CslReceiver::HandleTimer(void) +void SubMac::CslReceiver::ScheduleSampleWindow(void) { Window window;