avr: Clear the TCNT1 register on timer startup
Just to be safe, clear the TCNT1 register during init. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
f6cd51bfb7
commit
d891baa860
|
@ -93,12 +93,13 @@ DECL_SHUTDOWN(timer_reset);
|
|||
void
|
||||
timer_init(void)
|
||||
{
|
||||
irqstatus_t flag = irq_save();
|
||||
// no outputs
|
||||
TCCR1A = 0;
|
||||
// Normal Mode
|
||||
TCCR1B = 1<<CS10;
|
||||
// Setup for first irq
|
||||
irqstatus_t flag = irq_save();
|
||||
TCNT1 = 0;
|
||||
timer_kick();
|
||||
timer_repeat_set(timer_get() + 50);
|
||||
timer_reset();
|
||||
|
|
Loading…
Reference in New Issue