X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp.git/blobdiff_plain/4bc81323e51ac138e733c14eeb6f283ae706e904..refs/tags/hexrel-2:/avr/timer.c diff --git a/avr/timer.c b/avr/timer.c index 84a9737..56c7bed 100644 --- a/avr/timer.c +++ b/avr/timer.c @@ -15,14 +15,14 @@ #include "timer.h" /* timer interrupt/overflow counter */ -static volatile uint32_t timestamp; +volatile uint32_t timestamp; /*---------------------------------------------------------*/ -/* 1000Hz timer interrupt generated by OC1A */ +/* 1000Hz timer interrupt generated by OC2A */ /*---------------------------------------------------------*/ -ISR(TIMER1_COMPA_vect) +ISR(TIMER2_COMPA_vect) { static int_fast8_t tick_10ms; int_fast8_t i; @@ -34,12 +34,12 @@ ISR(TIMER1_COMPA_vect) if (i == 10) { i = 0; Stat |= S_10MS_TO; - + /* Drive timer procedure of low level disk I/O module */ //disk_timerproc(); } tick_10ms = i; - + } @@ -48,7 +48,7 @@ ISR(TIMER1_COMPA_vect) #if 0 -void do_10ms(void) +void do_10ms(void) { if (to_counter) to_counter--; @@ -59,6 +59,7 @@ void do_10ms(void) /*--------------------------------------------------------------------------*/ +#if 0 void timer_setup(void) { @@ -72,12 +73,12 @@ void timer_setup(void) TCCR1B = 0b00001001; TIMSK1 = _BV(OCIE1A); // Enable TC1.oca interrupt } - +#endif uint32_t get_timer(uint32_t base) { uint32_t ret; - + ATOMIC_BLOCK(ATOMIC_FORCEON) { ret = timestamp;