mirror of
https://github.com/espressif/openthread.git
synced 2026-10-11 02:07:40 +00:00
DataPollManager: Simplify restarting of data poll timer. (#1737)
This commit is contained in:
committed by
Jonathan Hui
parent
f90e33a4d5
commit
57b081da6d
@@ -329,16 +329,7 @@ void DataPollManager::ScheduleNextPoll(PollPeriodSelector aPollPeriodSelector)
|
||||
|
||||
if (mTimer.IsRunning())
|
||||
{
|
||||
uint32_t elapsedTime = Timer::GetNow() - mTimer.Gett0();
|
||||
|
||||
if (elapsedTime >= mPollPeriod)
|
||||
{
|
||||
SendDataPoll();
|
||||
}
|
||||
else
|
||||
{
|
||||
mTimer.Start(mPollPeriod - elapsedTime);
|
||||
}
|
||||
mTimer.StartAt(mTimer.Gett0(), mPollPeriod);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user