diff options
Diffstat (limited to 'src/avr/timer.c')
-rw-r--r-- | src/avr/timer.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/avr/timer.c b/src/avr/timer.c index 588669c1..e9ec8dd0 100644 --- a/src/avr/timer.c +++ b/src/avr/timer.c @@ -95,15 +95,6 @@ timer_init(void) } DECL_INIT(timer_init); -static void -timer_shutdown(void) -{ - // Reenable timer irq - timer_set(timer_get() + 50); - TIFR1 = 1<<OCF1A; -} -DECL_SHUTDOWN(timer_shutdown); - /**************************************************************** * 32bit timer wrappers @@ -208,3 +199,13 @@ timer_task(void) irq_enable(); } DECL_TASK(timer_task); + +static void +timer_shutdown(void) +{ + // Reenable timer irq + timer_set(timer_get() + 50); + TIFR1 = 1<<OCF1A; + timer_repeat_set(timer_get() + TIMER_IDLE_REPEAT_TICKS); +} +DECL_SHUTDOWN(timer_shutdown); |