2 * Copyright Droids Corporation, Microb Technology, Eirbot (2006)
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Revision : $Id: timer_intr.c,v 1.1.2.4 2009-01-30 20:18:36 zer0 Exp $
25 #include <aversive/timers.h>
28 #include <timer_definitions.h>
29 #include <timer_intr.h>
31 #include <timer_config.h>
33 volatile timer_callback_t timer_callback_table[_VECTORS_SIZE/4];
35 /*************************/
37 #if defined TIMER0_ENABLED && defined TIMER0_OVF_vect
38 DEFINE_OV_INTR(TIMER0_OVF_vect)
41 #if defined TIMER0_ENABLED && defined TIMER0_COMP_vect
42 DEFINE_OC_INTR(TIMER0_COMP_vect)
45 #if defined TIMER0_ENABLED && defined TIMER0_COMPA_vect
46 DEFINE_OC_INTR(TIMER0_COMPA_vect)
49 #if defined TIMER0_ENABLED && defined TIMER0_COMPB_vect
50 DEFINE_OC_INTR(TIMER0_COMPB_vect)
53 /*************************/
55 #if defined TIMER1_ENABLED && defined TIMER1_OVF_vect
56 DEFINE_OV_INTR(TIMER1_OVF_vect)
59 #if defined TIMER1A_ENABLED && defined TIMER1_COMPA_vect
60 DEFINE_OC_INTR(TIMER1_COMPA_vect)
63 #if defined TIMER1B_ENABLED && defined TIMER1_COMPB_vect
64 DEFINE_OC_INTR(TIMER1_COMPB_vect)
67 #if defined TIMER1C_ENABLED && defined TIMER1_COMPC_vect
68 DEFINE_OC_INTR(TIMER1_COMPC_vect)
71 /*************************/
73 #if defined TIMER2_ENABLED && defined TIMER2_OVF_vect
74 DEFINE_OV_INTR(TIMER2_OVF_vect)
77 #if defined TIMER2_ENABLED && defined TIMER2_COMP_vect
78 DEFINE_OC_INTR(TIMER2_COMP_vect)
81 #if defined TIMER2_ENABLED && defined TIMER2_COMPA_vect
82 DEFINE_OC_INTR(TIMER2_COMPA_vect)
85 #if defined TIMER2_ENABLED && defined TIMER2_COMPB_vect
86 DEFINE_OC_INTR(TIMER2_COMPB_vect)
89 /*************************/
91 #if defined TIMER3_ENABLED && defined TIMER3_OVF_vect
92 DEFINE_OV_INTR(TIMER3_OVF_vect)
95 #if defined TIMER3A_ENABLED && defined TIMER3_COMPA_vect
96 DEFINE_OC_INTR(TIMER3_COMPA_vect)
99 #if defined TIMER3B_ENABLED && defined TIMER3_COMPB_vect
100 DEFINE_OC_INTR(TIMER3_COMPB_vect)
103 #if defined TIMER3C_ENABLED && defined TIMER3_COMPC_vect
104 DEFINE_OC_INTR(TIMER3_COMPC_vect)
107 /*************************/
109 #if defined TIMER4_ENABLED && defined TIMER4_OVF_vect
110 DEFINE_OV_INTR(TIMER4_OVF_vect)
113 #if defined TIMER4A_ENABLED && defined TIMER4_COMPA_vect
114 DEFINE_OC_INTR(TIMER4_COMPA_vect)
117 #if defined TIMER4B_ENABLED && defined TIMER4_COMPB_vect
118 DEFINE_OC_INTR(TIMER4_COMPB_vect)
121 #if defined TIMER4C_ENABLED && defined TIMER4_COMPC_vect
122 DEFINE_OC_INTR(TIMER4_COMPC_vect)
125 /*************************/
127 #if defined TIMER5_ENABLED && defined TIMER5_OVF_vect
128 DEFINE_OV_INTR(TIMER5_OVF_vect)
131 #if defined TIMER5A_ENABLED && defined TIMER5_COMPA_vect
132 DEFINE_OC_INTR(TIMER5_COMPA_vect)
135 #if defined TIMER5B_ENABLED && defined TIMER5_COMPB_vect
136 DEFINE_OC_INTR(TIMER5_COMPB_vect)
139 #if defined TIMER5C_ENABLED && defined TIMER5_COMPC_vect
140 DEFINE_OC_INTR(TIMER5_COMPC_vect)
143 /*************************/
145 void timer_intr_init(void)
147 memset((void*)timer_callback_table, 0, sizeof(timer_callback_table));