#include <avr/power.h>
#include "timer.h"
Functions | |
void | timer1_init (void) |
initialize timer1 |
void timer1_init | ( | void | ) |
initialize timer1
Set up timer1 for continous counting.
The prescaler is set to 1/256. Therefore the elapsed time t can be calculated in the following way:
{ power_timer1_enable (); TCCR1A = 0; TCCR1B = _BV(CS12); /* prescaler 1/256 */ TIMSK1 = 0; /* no INT generation */ }