Timers: Fix update interval for timer2 IRQs being too low

This commit is contained in:
Connor McLaughlin 2020-08-31 22:01:05 +10:00
parent f187ee4971
commit d59eb05d94

View file

@ -349,7 +349,7 @@ TickCount Timers::GetTicksUntilNextInterrupt() const
min_ticks_for_this_timer = std::min(min_ticks_for_this_timer, static_cast<TickCount>(0xFFFF - cs.counter)); min_ticks_for_this_timer = std::min(min_ticks_for_this_timer, static_cast<TickCount>(0xFFFF - cs.counter));
if (cs.external_counting_enabled) // sysclk/8 for timer 2 if (cs.external_counting_enabled) // sysclk/8 for timer 2
min_ticks_for_this_timer = std::max<TickCount>(1, min_ticks_for_this_timer / 8); min_ticks_for_this_timer = std::max<TickCount>(1, min_ticks_for_this_timer * 8);
min_ticks = std::min(min_ticks, min_ticks_for_this_timer); min_ticks = std::min(min_ticks, min_ticks_for_this_timer);
} }