]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/timer.c
CP/M 3 compatible character i/o handling
[z180-stamp.git] / avr / timer.c
index 84a97370658ebd669b5d313da966330021d9a038..67b4a491018ee2d02507956f57274d8eec93dcf7 100644 (file)
@@ -4,8 +4,6 @@
 
 #include "common.h"
 
-//#include <avr/power.h>
-//#include <avr/pgmspace.h>
 #include <avr/interrupt.h>
 #include <util/atomic.h>
 
 #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 OC3A                */
 /*---------------------------------------------------------*/
 
-ISR(TIMER1_COMPA_vect)
+ISR(TIMER3_COMPA_vect)
 {
        static int_fast8_t tick_10ms;
        int_fast8_t i;
@@ -34,12 +32,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 +46,7 @@ ISR(TIMER1_COMPA_vect)
 
 #if 0
 
-void do_10ms(void) 
+void do_10ms(void)
 {
                if (to_counter)
                        to_counter--;
@@ -59,6 +57,7 @@ void do_10ms(void)
 /*--------------------------------------------------------------------------*/
 
 
+#if 0
 void timer_setup(void)
 {
 
@@ -72,12 +71,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;