Implemented on-demand PLL clock generation for the U4, U6 and U7 series USB AVRs...
[pub/USBasp.git] / Projects / Webserver / Lib / uip / clock.c
index 8632296..71eaf2b 100644 (file)
@@ -11,7 +11,7 @@
 volatile clock_time_t clock_datetime = 0;
 
 //Overflow interrupt
 volatile clock_time_t clock_datetime = 0;
 
 //Overflow interrupt
-ISR(TIMER1_COMPA_vect)
+ISR(TIMER1_COMPA_vect, ISR_BLOCK)
 {
        clock_datetime += 1;
 }
 {
        clock_datetime += 1;
 }
@@ -19,7 +19,7 @@ ISR(TIMER1_COMPA_vect)
 //Initialise the clock
 void clock_init()
 {
 //Initialise the clock
 void clock_init()
 {
-       OCR1A  = ((F_CPU / 1024) / 100);
+       OCR1A  = (((F_CPU / 1024) / 100) - 1);
        TCCR1B = ((1 << WGM12) | (1 << CS12) | (1 << CS10));
        TIMSK1 = (1 << OCIE1A);
 }
        TCCR1B = ((1 << WGM12) | (1 << CS12) | (1 << CS10));
        TIMSK1 = (1 << OCIE1A);
 }