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:
Kevin O'Connor 2018-01-07 22:21:38 -05:00
parent f6cd51bfb7
commit d891baa860
1 changed files with 2 additions and 1 deletions

View File

@ -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();