mirror of
https://github.com/espressif/openthread.git
synced 2026-09-20 16:07:36 +00:00
[channel-manager] fix interval units (#3857)
This commit is contained in:
@@ -428,13 +428,14 @@ otError ChannelManager::SetAutoChannelSelectionInterval(uint32_t aInterval)
|
||||
otError error = OT_ERROR_NONE;
|
||||
uint32_t prevInterval = mAutoSelectInterval;
|
||||
|
||||
VerifyOrExit((aInterval != 0) && (aInterval < TimerMilli::MsecToSec(Timer::kMaxDt)), error = OT_ERROR_INVALID_ARGS);
|
||||
VerifyOrExit((aInterval != 0) && (aInterval <= TimerMilli::MsecToSec(Timer::kMaxDt)),
|
||||
error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
mAutoSelectInterval = aInterval;
|
||||
|
||||
if (mAutoSelectEnabled && (mState == kStateIdle) && mTimer.IsRunning() && (prevInterval != aInterval))
|
||||
{
|
||||
mTimer.StartAt(mTimer.GetFireTime() - prevInterval, aInterval);
|
||||
mTimer.StartAt(mTimer.GetFireTime() - TimerMilli::SecToMsec(prevInterval), TimerMilli::SecToMsec(aInterval));
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
Reference in New Issue
Block a user