/*
*/
-
#include "common.h"
-
#include <avr/interrupt.h>
#include <util/atomic.h>
-
-//#include <stdio.h>
-
-
#include "timer.h"
/* timer interrupt/overflow counter */
-volatile uint32_t timestamp;
-
+/* counts up every ms. */
+static volatile
+uint32_t timestamp;
/*---------------------------------------------------------*/
/* 1000Hz timer interrupt generated by OC3A */
disk_timerproc();
}
tick_10ms = i;
-
}
-
/*--------------------------------------------------------------------------*/
-#if 0
-
-void do_10ms(void)
-{
- if (to_counter)
- to_counter--;
-}
-
-#endif
-
-/*--------------------------------------------------------------------------*/
-
-
#if 0
void timer_setup(void)
{
}
#endif
+/*--------------------------------------------------------------------------*/
+
uint32_t get_timer(uint32_t base)
{
uint32_t ret;
-
ATOMIC_BLOCK(ATOMIC_FORCEON)
{
ret = timestamp;