wrap around timer
This commit is contained in:
parent
5ee8a91479
commit
ad96e83f09
|
@ -135,7 +135,7 @@ impl<'a, T: HandleTrap, const TIMER_QUOTIENT: usize> Vm<'a, T, TIMER_QUOTIENT> {
|
||||||
else { return Ok(VmRunOk::End) };
|
else { return Ok(VmRunOk::End) };
|
||||||
|
|
||||||
if TIMER_QUOTIENT != 0 {
|
if TIMER_QUOTIENT != 0 {
|
||||||
self.timer += 1;
|
self.timer = self.timer.wrapping_add(1);
|
||||||
if self.timer % TIMER_QUOTIENT == 0 {
|
if self.timer % TIMER_QUOTIENT == 0 {
|
||||||
return Ok(VmRunOk::Timer);
|
return Ok(VmRunOk::Timer);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue