1 #include "global-conf.h"
5 #include <avr/interrupt.h>
7 #include <avr/sfr_defs.h>
9 #include "clock-arch.h"
12 volatile clock_time_t clock_datetime
= 0;
15 ISR(TIMER1_COMPA_vect
)
20 //Initialise the clock
23 OCR1A
= ((F_CPU
/ 1024) / 100);
24 TCCR1B
= ((1 << WGM12
) | (1 << CS12
) | (1 << CS10
));
25 TIMSK1
= (1 << OCIE1A
);
29 clock_time_t
clock_time()
34 time
= clock_datetime
;