From bad75eb419ea40943a54d7039a2bd51216233cbf Mon Sep 17 00:00:00 2001 From: Stefan Rupp Date: Wed, 12 Mar 2014 21:54:28 +0100 Subject: [PATCH] fixed timer initialization. timer works now. --- timer.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/timer.c b/timer.c index 693e548..48d7b11 100644 --- a/timer.c +++ b/timer.c @@ -17,10 +17,10 @@ /* timer_time gets increased on every interrupt * those interrupts happen every 1ms */ -static volatile uint32_t timer_time; +static volatile uint32_t _timer_time; ISR(TIMER0_COMPA_vect) { - ++timer_time; + ++_timer_time; return; } @@ -38,7 +38,7 @@ void timer_init(void) cli(); // Reset timer to zero - timer_time = 0; + _timer_time = 0; // - Time accuracy: 1 millisecond (corresponding frequency: 1kHz) // ==> F_CPU = 20Mhz @@ -52,8 +52,8 @@ void timer_init(void) // provided, we can't get any closer to the desired frequency of // 1kHz :( OCR0A = 77; - TCCR0B = (1<