4 #include <avr/interrupt.h>
6 #include <avr/sfr_defs.h>
11 volatile clock_time_t clock_datetime
= 0;
14 ISR(TIMER1_COMPA_vect
)
19 //Initialise the clock
22 OCR1A
= ((F_CPU
/ 1024) / 100);
23 TCCR1B
= ((1 << WGM12
) | (1 << CS12
) | (1 << CS10
));
24 TIMSK1
= (1 << OCIE1A
);
28 clock_time_t
clock_time()
33 time
= clock_datetime
;