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         TCCR1A 
= (1 << WGM12
); 
  25         TCCR1B 
= ((1 << CS12
) | (1 << CS10
)); 
  26         TIMSK1 
= (1 << OCIE1A
); 
  30 clock_time_t 
clock_time() 
  35                 time 
= clock_datetime
;