armcm_timer: Improve comments on wrap_timer code

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2019-07-27 22:05:50 -04:00
parent 7bc0a261ab
commit 92c2fbdce4
1 changed files with 5 additions and 3 deletions

View File

@ -68,7 +68,7 @@ udelay(uint32_t usecs)
;
}
// On fast cpus, schedule a recurring timer so SysTick doesn't overflow
// Dummy timer to avoid scheduling a SysTick irq greater than 0xffffff
static uint_fast8_t
timer_wrap_event(struct timer *t)
{
@ -82,7 +82,9 @@ static struct timer wrap_timer = {
void
timer_reset(void)
{
if (CONFIG_CLOCK_FREQ > 0xffffff * 10)
if (timer_from_us(100000) <= 0xffffff)
// Timer in sched.c already ensures SysTick wont overflow
return;
sched_add_timer(&wrap_timer);
}
DECL_SHUTDOWN(timer_reset);