mirror of https://github.com/Desuuuu/klipper.git
armcm_timer: Improve comments on wrap_timer code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
7bc0a261ab
commit
92c2fbdce4
|
@ -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
|
static uint_fast8_t
|
||||||
timer_wrap_event(struct timer *t)
|
timer_wrap_event(struct timer *t)
|
||||||
{
|
{
|
||||||
|
@ -82,8 +82,10 @@ static struct timer wrap_timer = {
|
||||||
void
|
void
|
||||||
timer_reset(void)
|
timer_reset(void)
|
||||||
{
|
{
|
||||||
if (CONFIG_CLOCK_FREQ > 0xffffff * 10)
|
if (timer_from_us(100000) <= 0xffffff)
|
||||||
sched_add_timer(&wrap_timer);
|
// Timer in sched.c already ensures SysTick wont overflow
|
||||||
|
return;
|
||||||
|
sched_add_timer(&wrap_timer);
|
||||||
}
|
}
|
||||||
DECL_SHUTDOWN(timer_reset);
|
DECL_SHUTDOWN(timer_reset);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue