summaryrefslogtreecommitdiff
path: root/avr
diff options
context:
space:
mode:
Diffstat (limited to 'avr')
-rw-r--r--avr/timer.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/avr/timer.c b/avr/timer.c
index 6fb19a8..7907bba 100644
--- a/avr/timer.c
+++ b/avr/timer.c
@@ -1,20 +1,15 @@
/*
*/
-
#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 */
@@ -38,27 +33,12 @@ ISR(TIMER3_COMPA_vect)
disk_timerproc();
}
tick_10ms = i;
-
}
-
/*--------------------------------------------------------------------------*/
#if 0
-
-void do_10ms(void)
-{
- if (to_counter)
- to_counter--;
-}
-
-#endif
-
-/*--------------------------------------------------------------------------*/
-
-
-#if 0
void timer_setup(void)
{
@@ -74,10 +54,11 @@ void timer_setup(void)
}
#endif
+/*--------------------------------------------------------------------------*/
+
uint32_t get_timer(uint32_t base)
{
uint32_t ret;
-
ATOMIC_BLOCK(ATOMIC_FORCEON)
{
ret = timestamp;