mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-12-24 19:09:33 +01:00
TimerQueue.dequeue: don't set SYST reload to 0
ARM Architecture Reference Manual says: "Setting SYST_RVR to zero has the effect of disabling the SysTick counter independently of the counter enable bit." If Monotonic's ratio is less than one, the timeout calculations can compute zero if next task is scheduled after current instant, but before next timer tick. This results in disabling SYST and freezing the timer queue.
This commit is contained in:
parent
725d5e1aa9
commit
fef738e832
1 changed files with 7 additions and 0 deletions
|
@ -68,6 +68,13 @@ where
|
|||
.map(|x| x / ratio.denominator)
|
||||
}) {
|
||||
None => MAX,
|
||||
|
||||
// ARM Architecture Reference Manual says:
|
||||
// "Setting SYST_RVR to zero has the effect of
|
||||
// disabling the SysTick counter independently
|
||||
// of the counter enable bit."
|
||||
Some(0) => 1,
|
||||
|
||||
Some(x) => cmp::min(MAX, x),
|
||||
};
|
||||
mem::transmute::<_, SYST>(()).set_reload(dur);
|
||||
|
|
Loading…
Reference in a new issue