From 89826c563e38a30d5bfc589905eb1202fa14b751 Mon Sep 17 00:00:00 2001 From: Leo C Date: Sat, 8 Sep 2018 20:29:11 +0200 Subject: [PATCH] move sys timer setup from main to timer.c --- avr/main.c | 9 +++------ avr/timer.c | 9 +++++++++ include/timer.h | 6 ++++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/avr/main.c b/avr/main.c index 1fba3cb..0a49a1f 100644 --- a/avr/main.c +++ b/avr/main.c @@ -110,7 +110,7 @@ void setup_avr(void) _BV(PRUSART3) | _BV(PRUSART2) | _BV(PRUSART1); - /* disable analog comparator */ + /* Disable analog comparator */ ACSR = _BV(ACD); /* Ports */ @@ -118,11 +118,8 @@ void setup_avr(void) CLKPR = _BV(CLKPCE); CLKPR = 0; - /* Timer */ - PRR1 &= ~_BV(PRTIM4); - OCR4A = F_CPU / 1000 - 1; /* Timer4: 1000Hz interval */ - TCCR4B = (0b00< + * (C) Copyright 2014,2018 Leo C. * - * SPDX-License-Identifier: GPL-2.0+ + * SPDX-License-Identifier: GPL-2.0 */ #ifndef TIMER_H @@ -9,6 +9,8 @@ #include "common.h" +void setup_timer(void); + uint32_t get_timer(uint32_t); #endif /* TIMER_H */ -- 2.39.2