/* * timer.c * * Created: 20.02.2019 20:56:18 * Author: jens */ #include #include "timer.h" void timer_init(uint16_t TIMER_RELOAD, TimerClockSel clockSel) { TCNT1 = TIMER_RELOAD; TCCR1A = 0x00; TCCR1B = (TCCR1B & TimerClockSel_mask) | clockSel; TIMSK1 = (1 << TOIE1) ; // Enable timer1 overflow interrupt(TOIE1) }