From: lottaviano Date: Mon, 29 Mar 2010 21:06:48 +0000 (+0000) Subject: Add timer support for AVR 328P (Arduino) X-Git-Tag: 2.5.0~599 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=164c71e645763cc0bdd059f108b83cb973420533;p=bertos.git Add timer support for AVR 328P (Arduino) git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3309 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/cpu/avr/drv/timer_avr.c b/bertos/cpu/avr/drv/timer_avr.c index 53a5c007..1ef5caec 100644 --- a/bertos/cpu/avr/drv/timer_avr.c +++ b/bertos/cpu/avr/drv/timer_avr.c @@ -26,7 +26,7 @@ * invalidate any other reasons why the executable file might be covered by * the GNU General Public License. * - * Copyright 2005 Develer S.r.l. (http://www.develer.com/) + * Copyright 2005, 2010 Develer S.r.l. (http://www.develer.com/) * * --> * @@ -34,6 +34,7 @@ * * \author Bernie Innocenti * \author Francesco Sacchi + * \author Luca Ottaviano * * \brief Low-level timer module for AVR (implementation). * @@ -50,7 +51,7 @@ #include -#if CPU_AVR_ATMEGA1281 || CPU_AVR_ATMEGA168 +#if CPU_AVR_ATMEGA1281 || CPU_AVR_ATMEGA168 || CPU_AVR_ATMEGA328P #define REG_TIFR0 TIFR0 #define REG_TIFR1 TIFR1 #define REG_TIFR2 TIFR2 diff --git a/bertos/cpu/avr/drv/timer_avr.h b/bertos/cpu/avr/drv/timer_avr.h index a9209bdc..a2a413b6 100644 --- a/bertos/cpu/avr/drv/timer_avr.h +++ b/bertos/cpu/avr/drv/timer_avr.h @@ -26,7 +26,7 @@ * invalidate any other reasons why the executable file might be covered by * the GNU General Public License. * - * Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/) + * Copyright 2003, 2004, 2005, 2010 Develer S.r.l. (http://www.develer.com/) * Copyright 2000 Bernie Innocenti * * --> @@ -37,6 +37,7 @@ * * \author Bernie Innocenti * \author Francesco Sacchi + * \author Luca Ottaviano * */ @@ -73,7 +74,7 @@ #define TIMER_PRESCALER 64 #define TIMER_HW_BITS 8 - #if CPU_AVR_ATMEGA1281 || CPU_AVR_ATMEGA168 + #if CPU_AVR_ATMEGA1281 || CPU_AVR_ATMEGA168 || CPU_AVR_ATMEGA328P #define DEFINE_TIMER_ISR DECLARE_ISR_CONTEXT_SWITCH(TIMER0_COMPA_vect) #else #define DEFINE_TIMER_ISR DECLARE_ISR_CONTEXT_SWITCH(TIMER0_COMP_vect) @@ -112,7 +113,7 @@ #define TIMER_PRESCALER 64 #define TIMER_HW_BITS 8 - #if CPU_AVR_ATMEGA1281 || CPU_AVR_ATMEGA168 + #if CPU_AVR_ATMEGA1281 || CPU_AVR_ATMEGA168 || CPU_AVR_ATMEGA328P #define DEFINE_TIMER_ISR DECLARE_ISR_CONTEXT_SWITCH(TIMER2_COMPA_vect) #else #define DEFINE_TIMER_ISR DECLARE_ISR_CONTEXT_SWITCH(TIMER2_COMP_vect)