samd21: Minor simplification to timer init code

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2018-11-29 14:57:49 -05:00
parent d6f3f6b664
commit 0fd2dd7c11
1 changed files with 2 additions and 2 deletions

View File

@ -47,8 +47,8 @@ timer_init(void)
tc->CTRLA.reg = TC_CTRLA_MODE_COUNT32;
NVIC_SetPriority(TC4_IRQn, 2);
NVIC_EnableIRQ(TC4_IRQn);
TC4->COUNT32.INTENSET.reg = TC_INTENSET_MC0;
TC4->COUNT32.COUNT.reg = 0;
tc->INTENSET.reg = TC_INTENSET_MC0;
tc->COUNT.reg = 0;
timer_kick();
tc->CTRLA.reg = TC_CTRLA_MODE_COUNT32 | TC_CTRLA_ENABLE;
irq_restore(flag);