alarm: fix bug in _setup_alarm

We did not set the correct now_period previously but it wasn't conspicuous
because the bug triggered not before a full period had passed which on most
platforms is a pretty long time.

Ref #2490
This commit is contained in:
Martin Stein 2017-10-04 13:10:11 +02:00 committed by Christian Helmuth
parent 9705c90d87
commit df71e02ef6
1 changed files with 1 additions and 1 deletions

View File

@ -198,7 +198,7 @@ void Alarm_scheduler::_setup_alarm(Alarm &alarm, Alarm::Time period, Alarm::Time
if (alarm._active)
_unsynchronized_dequeue(&alarm);
alarm._assign(period, deadline, _now > deadline, this);
alarm._assign(period, deadline, _now > deadline ? !_now_period : _now_period, this);
_unsynchronized_enqueue(&alarm);
}