From: Olivier Matz Date: Sun, 29 Sep 2013 14:47:31 +0000 (+0200) Subject: fix compilation with new avr-gcc and avr-libc X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=1914199c91d6c65dbcad7f1f7f5fac23741fa2fd;p=aversive.git fix compilation with new avr-gcc and avr-libc changes in interupt signal names and unused vars --- diff --git a/modules/comm/i2c/i2c.c b/modules/comm/i2c/i2c.c index 680655a..81dae5c 100644 --- a/modules/comm/i2c/i2c.c +++ b/modules/comm/i2c/i2c.c @@ -352,6 +352,9 @@ i2c_reset(void) int8_t i2c_recv(uint8_t dest_add, uint8_t size, uint8_t ctrl) { #ifndef CONFIG_MODULE_I2C_MASTER + (void)dest_add; + (void)size; + (void)ctrl; return -EINVAL; #else uint8_t flags; @@ -535,7 +538,10 @@ void i2c_debug(void) * Interrupt routing for I2C. Refer to datasheets for more * informations. */ -SIGNAL(SIG_2WIRE_SERIAL) +#if !defined(TWI_vect) && defined(SIG_2WIRE_SERIAL) +#define TWI_vect SIG_2WIRE_SERIAL +#endif +SIGNAL(TWI_vect) { uint8_t hard_status; uint8_t command = (1< -#if defined TIMER0_ENABLED && defined SIG_OUTPUT_COMPARE0 -DEFINE_REGISTER_OC_INTR_AT_TICS(0) +#if defined TIMER0_ENABLED && defined TIMER0_COMP_vect +DEFINE_REGISTER_OC_INTR_AT_TICS(0, TIMER0_COMP_vect) #endif -#if defined TIMER0A_ENABLED && defined SIG_OUTPUT_COMPARE0A -DEFINE_REGISTER_OC_INTR_AT_TICS(0A) +#if defined TIMER0A_ENABLED && defined TIMER0_COMPA_vect +DEFINE_REGISTER_OC_INTR_AT_TICS(0, TIMER0_COMPA_vect) #endif -#if defined TIMER0B_ENABLED && defined SIG_OUTPUT_COMPARE0B -DEFINE_REGISTER_OC_INTR_AT_TICS(0B) +#if defined TIMER0B_ENABLED && defined TIMER0_COMPB_vect +DEFINE_REGISTER_OC_INTR_AT_TICS(0, TIMER0_COMPB_vect) #endif diff --git a/modules/hardware/timer/timer0_register_OC_in_us.c b/modules/hardware/timer/timer0_register_OC_in_us.c index 8eb0765..c59a570 100644 --- a/modules/hardware/timer/timer0_register_OC_in_us.c +++ b/modules/hardware/timer/timer0_register_OC_in_us.c @@ -30,15 +30,15 @@ #include -#if defined TIMER0_ENABLED && defined SIG_OUTPUT_COMPARE0 -DEFINE_REGISTER_OC_INTR_IN_US(0,0) +#if defined TIMER0_ENABLED && defined TIMER0_COMP_vect_id +DEFINE_REGISTER_OC_INTR_IN_US(0,0,TIMER0_COMP_vect) #endif -#if defined TIMER0A_ENABLED && defined SIG_OUTPUT_COMPARE0A -DEFINE_REGISTER_OC_INTR_IN_US(0,0A) +#if defined TIMER0A_ENABLED && defined TIMER0_COMP_vect_idA +DEFINE_REGISTER_OC_INTR_IN_US(0,0A,TIMER0_COMPA_vect) #endif -#if defined TIMER0B_ENABLED && defined SIG_OUTPUT_COMPARE0B -DEFINE_REGISTER_OC_INTR_IN_US(0,0B) +#if defined TIMER0B_ENABLED && defined TIMER0_COMP_vect_idB +DEFINE_REGISTER_OC_INTR_IN_US(0,0B,TIMER0_COMPB_vect) #endif diff --git a/modules/hardware/timer/timer0_register_OV.c b/modules/hardware/timer/timer0_register_OV.c index 4d24614..7e297de 100644 --- a/modules/hardware/timer/timer0_register_OV.c +++ b/modules/hardware/timer/timer0_register_OV.c @@ -30,7 +30,7 @@ #include -#if defined TIMER0_ENABLED && defined SIG_OVERFLOW0 -DEFINE_REGISTER_OV_INTR(0) +#if defined TIMER0_ENABLED && defined TIMER0_OVF_vect +DEFINE_REGISTER_OV_INTR(0, TIMER0_OVF_vect) #endif diff --git a/modules/hardware/timer/timer1_register_OC_at_tics.c b/modules/hardware/timer/timer1_register_OC_at_tics.c index fa8ab8d..1f3d64b 100644 --- a/modules/hardware/timer/timer1_register_OC_at_tics.c +++ b/modules/hardware/timer/timer1_register_OC_at_tics.c @@ -30,15 +30,15 @@ #include -#if defined TIMER1A_ENABLED && defined SIG_OUTPUT_COMPARE1A -DEFINE_REGISTER_OC_INTR_AT_TICS(1A) +#if defined TIMER1A_ENABLED && defined TIMER1_COMPA_vect +DEFINE_REGISTER_OC_INTR_AT_TICS(1, TIMER1_COMPA_vect) #endif -#if defined TIMER1B_ENABLED && defined SIG_OUTPUT_COMPARE1B -DEFINE_REGISTER_OC_INTR_AT_TICS(1B) +#if defined TIMER1B_ENABLED && defined TIMER1_COMPB_vect +DEFINE_REGISTER_OC_INTR_AT_TICS(1, TIMER1_COMPB_vect) #endif -#if defined TIMER1C_ENABLED && defined SIG_OUTPUT_COMPARE1C -DEFINE_REGISTER_OC_INTR_AT_TICS(1C) +#if defined TIMER1C_ENABLED && defined TIMER1_COMPC_vect +DEFINE_REGISTER_OC_INTR_AT_TICS(1, TIMER1_COMPC_vect) #endif diff --git a/modules/hardware/timer/timer1_register_OC_in_us.c b/modules/hardware/timer/timer1_register_OC_in_us.c index 81af93a..463c5b0 100644 --- a/modules/hardware/timer/timer1_register_OC_in_us.c +++ b/modules/hardware/timer/timer1_register_OC_in_us.c @@ -30,15 +30,15 @@ #include -#if defined TIMER1A_ENABLED && defined SIG_OUTPUT_COMPARE1A -DEFINE_REGISTER_OC_INTR_IN_US(1,1A) +#if defined TIMER1A_ENABLED && defined TIMER1_COMP_vect_idA +DEFINE_REGISTER_OC_INTR_IN_US(1,1A,TIMER1_COMPA_vect) #endif -#if defined TIMER1B_ENABLED && defined SIG_OUTPUT_COMPARE1B -DEFINE_REGISTER_OC_INTR_IN_US(1,1B) +#if defined TIMER1B_ENABLED && defined TIMER1_COMP_vect_idB +DEFINE_REGISTER_OC_INTR_IN_US(1,1B,TIMER1_COMPB_vect) #endif -#if defined TIMER1C_ENABLED && defined SIG_OUTPUT_COMPARE1C -DEFINE_REGISTER_OC_INTR_IN_US(1,1C) +#if defined TIMER1C_ENABLED && defined TIMER1_COMP_vect_idC +DEFINE_REGISTER_OC_INTR_IN_US(1,1C,TIMER1_COMPC_vect) #endif diff --git a/modules/hardware/timer/timer1_register_OV.c b/modules/hardware/timer/timer1_register_OV.c index be2a049..597c14e 100644 --- a/modules/hardware/timer/timer1_register_OV.c +++ b/modules/hardware/timer/timer1_register_OV.c @@ -30,7 +30,7 @@ #include -#if defined TIMER1_ENABLED && defined SIG_OVERFLOW1 -DEFINE_REGISTER_OV_INTR(1) +#if defined TIMER1_ENABLED && defined TIMER1_OVF_vect +DEFINE_REGISTER_OV_INTR(1, TIMER1_OVF_vect) #endif diff --git a/modules/hardware/timer/timer2_register_OC_at_tics.c b/modules/hardware/timer/timer2_register_OC_at_tics.c index 84c5c2b..4e5bf4a 100644 --- a/modules/hardware/timer/timer2_register_OC_at_tics.c +++ b/modules/hardware/timer/timer2_register_OC_at_tics.c @@ -30,7 +30,7 @@ #include -#if defined TIMER2_ENABLED && defined SIG_OUTPUT_COMPARE2 -DEFINE_REGISTER_OC_INTR_AT_TICS(2) +#if defined TIMER2_ENABLED && defined TIMER2_COMP_vect_id +DEFINE_REGISTER_OC_INTR_AT_TICS(2, TIMER2_COMP_vect) #endif diff --git a/modules/hardware/timer/timer2_register_OC_in_us.c b/modules/hardware/timer/timer2_register_OC_in_us.c index dbe0f7a..e8bead6 100644 --- a/modules/hardware/timer/timer2_register_OC_in_us.c +++ b/modules/hardware/timer/timer2_register_OC_in_us.c @@ -30,7 +30,7 @@ #include -#if defined TIMER2_ENABLED && defined SIG_OUTPUT_COMPARE2 -DEFINE_REGISTER_OC_INTR_IN_US(2,2) +#if defined TIMER2_ENABLED && defined TIMER2_COMP_vect_id +DEFINE_REGISTER_OC_INTR_IN_US(2,2,TIMER2_COMP_vect) #endif diff --git a/modules/hardware/timer/timer2_register_OV.c b/modules/hardware/timer/timer2_register_OV.c index 3485565..f205b48 100644 --- a/modules/hardware/timer/timer2_register_OV.c +++ b/modules/hardware/timer/timer2_register_OV.c @@ -30,7 +30,7 @@ #include -#if defined TIMER2_ENABLED && defined SIG_OVERFLOW2 -DEFINE_REGISTER_OV_INTR(2) +#if defined TIMER2_ENABLED && defined TIMER2_OVF_vect +DEFINE_REGISTER_OV_INTR(2, TIMER2_OVF_vect) #endif diff --git a/modules/hardware/timer/timer3_register_OC_at_tics.c b/modules/hardware/timer/timer3_register_OC_at_tics.c index 1af1df0..ded5523 100644 --- a/modules/hardware/timer/timer3_register_OC_at_tics.c +++ b/modules/hardware/timer/timer3_register_OC_at_tics.c @@ -30,15 +30,15 @@ #include -#if defined TIMER3A_ENABLED && defined SIG_OUTPUT_COMPARE3A -DEFINE_REGISTER_OC_INTR_AT_TICS(3A) +#if defined TIMER3A_ENABLED && defined TIMER3_COMPA_vect +DEFINE_REGISTER_OC_INTR_AT_TICS(3, TIMER3_COMPA_vect) #endif -#if defined TIMER3B_ENABLED && defined SIG_OUTPUT_COMPARE3B -DEFINE_REGISTER_OC_INTR_AT_TICS(3B) +#if defined TIMER3B_ENABLED && defined TIMER3_COMPB_vect +DEFINE_REGISTER_OC_INTR_AT_TICS(3, TIMER3_COMPB_vect) #endif -#if defined TIMER3C_ENABLED && defined SIG_OUTPUT_COMPARE3C -DEFINE_REGISTER_OC_INTR_AT_TICS(3C) +#if defined TIMER3C_ENABLED && defined TIMER3_COMPC_vect +DEFINE_REGISTER_OC_INTR_AT_TICS(3, TIMER3_COMPC_vect) #endif diff --git a/modules/hardware/timer/timer3_register_OC_in_us.c b/modules/hardware/timer/timer3_register_OC_in_us.c index 21c4e73..a864995 100644 --- a/modules/hardware/timer/timer3_register_OC_in_us.c +++ b/modules/hardware/timer/timer3_register_OC_in_us.c @@ -30,15 +30,15 @@ #include -#if defined TIMER3A_ENABLED && defined SIG_OUTPUT_COMPARE3A -DEFINE_REGISTER_OC_INTR_IN_US(3,3A) +#if defined TIMER3A_ENABLED && defined TIMER3_COMP_vect_idA +DEFINE_REGISTER_OC_INTR_IN_US(3,3A,TIMER3_COMPA_vect) #endif -#if defined TIMER3B_ENABLED && defined SIG_OUTPUT_COMPARE3B -DEFINE_REGISTER_OC_INTR_IN_US(3,3B) +#if defined TIMER3B_ENABLED && defined TIMER3_COMP_vect_idB +DEFINE_REGISTER_OC_INTR_IN_US(3,3B,TIMER3_COMPB_vect) #endif -#if defined TIMER3C_ENABLED && defined SIG_OUTPUT_COMPARE3C -DEFINE_REGISTER_OC_INTR_IN_US(3,3C) +#if defined TIMER3C_ENABLED && defined TIMER3_COMP_vect_idC +DEFINE_REGISTER_OC_INTR_IN_US(3,3C,TIMER3_COMPC_vect) #endif diff --git a/modules/hardware/timer/timer3_register_OV.c b/modules/hardware/timer/timer3_register_OV.c index 72232c8..acb5e3e 100644 --- a/modules/hardware/timer/timer3_register_OV.c +++ b/modules/hardware/timer/timer3_register_OV.c @@ -30,7 +30,7 @@ #include -#if defined TIMER3_ENABLED && defined SIG_OVERFLOW3 -DEFINE_REGISTER_OV_INTR(3) +#if defined TIMER3_ENABLED && defined TIMER3_OVF_vect +DEFINE_REGISTER_OV_INTR(3, TIMER3_OVF_vect) #endif diff --git a/modules/hardware/timer/timer4_register_OC_at_tics.c b/modules/hardware/timer/timer4_register_OC_at_tics.c index 02c3294..289be8a 100644 --- a/modules/hardware/timer/timer4_register_OC_at_tics.c +++ b/modules/hardware/timer/timer4_register_OC_at_tics.c @@ -30,15 +30,15 @@ #include -#if defined TIMER4A_ENABLED && defined SIG_OUTPUT_COMPARE4A -DEFINE_REGISTER_OC_INTR_AT_TICS(4A) +#if defined TIMER4A_ENABLED && defined TIMER4_COMPA_vect +DEFINE_REGISTER_OC_INTR_AT_TICS(4, TIMER4_COMPA_vect) #endif -#if defined TIMER4B_ENABLED && defined SIG_OUTPUT_COMPARE4B -DEFINE_REGISTER_OC_INTR_AT_TICS(4B) +#if defined TIMER4B_ENABLED && defined TIMER4_COMPB_vect +DEFINE_REGISTER_OC_INTR_AT_TICS(4, TIMER4_COMPB_vect) #endif -#if defined TIMER4C_ENABLED && defined SIG_OUTPUT_COMPARE4C -DEFINE_REGISTER_OC_INTR_AT_TICS(4C) +#if defined TIMER4C_ENABLED && defined TIMER4_COMPC_vect +DEFINE_REGISTER_OC_INTR_AT_TICS(4, TIMER4_COMPC_vect) #endif diff --git a/modules/hardware/timer/timer4_register_OC_in_us.c b/modules/hardware/timer/timer4_register_OC_in_us.c index a52ba68..cc90dd8 100644 --- a/modules/hardware/timer/timer4_register_OC_in_us.c +++ b/modules/hardware/timer/timer4_register_OC_in_us.c @@ -30,15 +30,15 @@ #include -#if defined TIMER4A_ENABLED && defined SIG_OUTPUT_COMPARE4A -DEFINE_REGISTER_OC_INTR_IN_US(4,4A) +#if defined TIMER4A_ENABLED && defined TIMER4_COMP_vect_idA +DEFINE_REGISTER_OC_INTR_IN_US(4,4A,TIMER4_COMPA_vect) #endif -#if defined TIMER4B_ENABLED && defined SIG_OUTPUT_COMPARE4B -DEFINE_REGISTER_OC_INTR_IN_US(4,4B) +#if defined TIMER4B_ENABLED && defined TIMER4_COMP_vect_idB +DEFINE_REGISTER_OC_INTR_IN_US(4,4B,TIMER4_COMPB_vect) #endif -#if defined TIMER4C_ENABLED && defined SIG_OUTPUT_COMPARE4C -DEFINE_REGISTER_OC_INTR_IN_US(4,4C) +#if defined TIMER4C_ENABLED && defined TIMER4_COMP_vect_idC +DEFINE_REGISTER_OC_INTR_IN_US(4,4C,TIMER4_COMPC_vect) #endif diff --git a/modules/hardware/timer/timer4_register_OV.c b/modules/hardware/timer/timer4_register_OV.c index 7fcb74e..d2d86bc 100644 --- a/modules/hardware/timer/timer4_register_OV.c +++ b/modules/hardware/timer/timer4_register_OV.c @@ -30,7 +30,7 @@ #include -#if defined TIMER4_ENABLED && defined SIG_OVERFLOW4 -DEFINE_REGISTER_OV_INTR(4) +#if defined TIMER4_ENABLED && defined TIMER4_OVF_vect +DEFINE_REGISTER_OV_INTR(4, TIMER4_OVF_vect) #endif diff --git a/modules/hardware/timer/timer5_register_OC_at_tics.c b/modules/hardware/timer/timer5_register_OC_at_tics.c index 99eb009..818e614 100644 --- a/modules/hardware/timer/timer5_register_OC_at_tics.c +++ b/modules/hardware/timer/timer5_register_OC_at_tics.c @@ -30,15 +30,15 @@ #include -#if defined TIMER5A_ENABLED && defined SIG_OUTPUT_COMPARE5A -DEFINE_REGISTER_OC_INTR_AT_TICS(5A) +#if defined TIMER5A_ENABLED && defined TIMER5_COMPA_vect +DEFINE_REGISTER_OC_INTR_AT_TICS(5, TIMER5_COMPA_vect) #endif -#if defined TIMER5B_ENABLED && defined SIG_OUTPUT_COMPARE5B -DEFINE_REGISTER_OC_INTR_AT_TICS(5B) +#if defined TIMER5B_ENABLED && defined TIMER5_COMPB_vect +DEFINE_REGISTER_OC_INTR_AT_TICS(5, TIMER5_COMPB_vect) #endif -#if defined TIMER5C_ENABLED && defined SIG_OUTPUT_COMPARE5C -DEFINE_REGISTER_OC_INTR_AT_TICS(5C) +#if defined TIMER5C_ENABLED && defined TIMER5_COMPC_vect +DEFINE_REGISTER_OC_INTR_AT_TICS(5, TIMER5_COMPC_vect) #endif diff --git a/modules/hardware/timer/timer5_register_OC_in_us.c b/modules/hardware/timer/timer5_register_OC_in_us.c index a65154e..b2db2e8 100644 --- a/modules/hardware/timer/timer5_register_OC_in_us.c +++ b/modules/hardware/timer/timer5_register_OC_in_us.c @@ -30,15 +30,15 @@ #include -#if defined TIMER5A_ENABLED && defined SIG_OUTPUT_COMPARE5A -DEFINE_REGISTER_OC_INTR_IN_US(5,5A) +#if defined TIMER5A_ENABLED && defined TIMER5_COMP_vect_idA +DEFINE_REGISTER_OC_INTR_IN_US(5,5A,TIMER5_COMPA_vect) #endif -#if defined TIMER5B_ENABLED && defined SIG_OUTPUT_COMPARE5B -DEFINE_REGISTER_OC_INTR_IN_US(5,5B) +#if defined TIMER5B_ENABLED && defined TIMER5_COMP_vect_idB +DEFINE_REGISTER_OC_INTR_IN_US(5,5B,TIMER5_COMPB_vect) #endif -#if defined TIMER5C_ENABLED && defined SIG_OUTPUT_COMPARE5C -DEFINE_REGISTER_OC_INTR_IN_US(5,5C) +#if defined TIMER5C_ENABLED && defined TIMER5_COMP_vect_idC +DEFINE_REGISTER_OC_INTR_IN_US(5,5C,TIMER5_COMPC_vect) #endif diff --git a/modules/hardware/timer/timer5_register_OV.c b/modules/hardware/timer/timer5_register_OV.c index b10ab02..aae46ff 100644 --- a/modules/hardware/timer/timer5_register_OV.c +++ b/modules/hardware/timer/timer5_register_OV.c @@ -30,7 +30,7 @@ #include -#if defined TIMER5_ENABLED && defined SIG_OVERFLOW5 -DEFINE_REGISTER_OV_INTR(5) +#if defined TIMER5_ENABLED && defined TIMER5_OVF_vect +DEFINE_REGISTER_OV_INTR(5, TIMER5_OVF_vect) #endif diff --git a/modules/hardware/timer/timer_definitions.h b/modules/hardware/timer/timer_definitions.h index 6bd1c1f..9beea35 100644 --- a/modules/hardware/timer/timer_definitions.h +++ b/modules/hardware/timer/timer_definitions.h @@ -59,27 +59,27 @@ void timer##x##_set(uint16_t t) \ #define DEFINE_OV_INTR(x) \ SIGNAL(x) \ { \ - if(timer_OV_callback_table[x##_NUM]) \ - timer_OV_callback_table[x##_NUM](); \ + if(timer_callback_table[x##_num]) \ + timer_callback_table[x##_num](); \ } #define DEFINE_OC_INTR(x) \ SIGNAL(x) \ { \ - if(timer_OC_callback_table[x##_NUM]) \ - timer_OC_callback_table[x##_NUM](); \ + if(timer_callback_table[x##_num]) \ + timer_callback_table[x##_num](); \ } -#define DEFINE_REGISTER_OV_INTR(x) \ +#define DEFINE_REGISTER_OV_INTR(x, vector) \ \ void timer##x##_register_OV_intr(void (*func)(void)) \ { \ uint8_t flags; \ \ IRQ_LOCK(flags); \ - timer_OV_callback_table[SIG_OVERFLOW##x##_NUM] = func; \ + timer_callback_table[vector##_num] = func; \ if (func) { \ TOIE##x##_REG |= (1< -volatile timer_callback_t timer_OV_callback_table[SIG_OVERFLOW_TOTAL_NUM]; -volatile timer_callback_t timer_OC_callback_table[SIG_OUTPUT_COMPARE_TOTAL_NUM]; +volatile timer_callback_t timer_callback_table[_VECTORS_SIZE/4]; /*************************/ -#if defined TIMER0_ENABLED && defined SIG_OVERFLOW0 -DEFINE_OV_INTR(SIG_OVERFLOW0) +#if defined TIMER0_ENABLED && defined TIMER0_OVF_vect +DEFINE_OV_INTR(TIMER0_OVF_vect) #endif -#if defined TIMER0_ENABLED && defined SIG_OUTPUT_COMPARE0 -DEFINE_OC_INTR(SIG_OUTPUT_COMPARE0) +#if defined TIMER0_ENABLED && defined TIMER0_COMP_vect_id +DEFINE_OC_INTR(TIMER0_COMP_vect_id) #endif -#if defined TIMER0_ENABLED && defined SIG_OUTPUT_COMPARE0A -DEFINE_OC_INTR(SIG_OUTPUT_COMPARE0A) +#if defined TIMER0_ENABLED && defined TIMER0_COMPA_vect +DEFINE_OC_INTR(TIMER0_COMPA_vect) #endif -#if defined TIMER0_ENABLED && defined SIG_OUTPUT_COMPARE0B -DEFINE_OC_INTR(SIG_OUTPUT_COMPARE0B) +#if defined TIMER0_ENABLED && defined TIMER0_COMPB_vect +DEFINE_OC_INTR(TIMER0_COMPB_vect) #endif /*************************/ -#if defined TIMER1_ENABLED && defined SIG_OVERFLOW1 -DEFINE_OV_INTR(SIG_OVERFLOW1) +#if defined TIMER1_ENABLED && defined TIMER1_OVF_vect +DEFINE_OV_INTR(TIMER1_OVF_vect) #endif -#if defined TIMER1A_ENABLED && defined SIG_OUTPUT_COMPARE1A -DEFINE_OC_INTR(SIG_OUTPUT_COMPARE1A) +#if defined TIMER1A_ENABLED && defined TIMER1_COMPA_vect +DEFINE_OC_INTR(TIMER1_COMPA_vect) #endif -#if defined TIMER1B_ENABLED && defined SIG_OUTPUT_COMPARE1B -DEFINE_OC_INTR(SIG_OUTPUT_COMPARE1B) +#if defined TIMER1B_ENABLED && defined TIMER1_COMPB_vect +DEFINE_OC_INTR(TIMER1_COMPB_vect) #endif -#if defined TIMER1C_ENABLED && defined SIG_OUTPUT_COMPARE1C -DEFINE_OC_INTR(SIG_OUTPUT_COMPARE1C) +#if defined TIMER1C_ENABLED && defined TIMER1_COMPC_vect +DEFINE_OC_INTR(TIMER1_COMPC_vect) #endif /*************************/ -#if defined TIMER2_ENABLED && defined SIG_OVERFLOW2 -DEFINE_OV_INTR(SIG_OVERFLOW2) +#if defined TIMER2_ENABLED && defined TIMER2_OVF_vect +DEFINE_OV_INTR(TIMER2_OVF_vect) #endif -#if defined TIMER2_ENABLED && defined SIG_OUTPUT_COMPARE2 -DEFINE_OC_INTR(SIG_OUTPUT_COMPARE2) +#if defined TIMER2_ENABLED && defined TIMER2_COMP_vect_id +DEFINE_OC_INTR(TIMER2_COMP_vect_id) #endif -#if defined TIMER2_ENABLED && defined SIG_OUTPUT_COMPARE2A -DEFINE_OC_INTR(SIG_OUTPUT_COMPARE2A) +#if defined TIMER2_ENABLED && defined TIMER2_COMPA_vect +DEFINE_OC_INTR(TIMER2_COMPA_vect) #endif -#if defined TIMER2_ENABLED && defined SIG_OUTPUT_COMPARE2B -DEFINE_OC_INTR(SIG_OUTPUT_COMPARE2B) +#if defined TIMER2_ENABLED && defined TIMER2_COMPB_vect +DEFINE_OC_INTR(TIMER2_COMPB_vect) #endif /*************************/ -#if defined TIMER3_ENABLED && defined SIG_OVERFLOW3 -DEFINE_OV_INTR(SIG_OVERFLOW3) +#if defined TIMER3_ENABLED && defined TIMER3_OVF_vect +DEFINE_OV_INTR(TIMER3_OVF_vect) #endif -#if defined TIMER3A_ENABLED && defined SIG_OUTPUT_COMPARE3A -DEFINE_OC_INTR(SIG_OUTPUT_COMPARE3A) +#if defined TIMER3A_ENABLED && defined TIMER3_COMPA_vect +DEFINE_OC_INTR(TIMER3_COMPA_vect) #endif -#if defined TIMER3B_ENABLED && defined SIG_OUTPUT_COMPARE3B -DEFINE_OC_INTR(SIG_OUTPUT_COMPARE3B) +#if defined TIMER3B_ENABLED && defined TIMER3_COMPB_vect +DEFINE_OC_INTR(TIMER3_COMPB_vect) #endif -#if defined TIMER3C_ENABLED && defined SIG_OUTPUT_COMPARE3C -DEFINE_OC_INTR(SIG_OUTPUT_COMPARE3C) +#if defined TIMER3C_ENABLED && defined TIMER3_COMPC_vect +DEFINE_OC_INTR(TIMER3_COMPC_vect) #endif /*************************/ -#if defined TIMER4_ENABLED && defined SIG_OVERFLOW4 -DEFINE_OV_INTR(SIG_OVERFLOW4) +#if defined TIMER4_ENABLED && defined TIMER4_OVF_vect +DEFINE_OV_INTR(TIMER4_OVF_vect) #endif -#if defined TIMER4A_ENABLED && defined SIG_OUTPUT_COMPARE4A -DEFINE_OC_INTR(SIG_OUTPUT_COMPARE4A) +#if defined TIMER4A_ENABLED && defined TIMER4_COMPA_vect +DEFINE_OC_INTR(TIMER4_COMPA_vect) #endif -#if defined TIMER4B_ENABLED && defined SIG_OUTPUT_COMPARE4B -DEFINE_OC_INTR(SIG_OUTPUT_COMPARE4B) +#if defined TIMER4B_ENABLED && defined TIMER4_COMPB_vect +DEFINE_OC_INTR(TIMER4_COMPB_vect) #endif -#if defined TIMER4C_ENABLED && defined SIG_OUTPUT_COMPARE4C -DEFINE_OC_INTR(SIG_OUTPUT_COMPARE4C) +#if defined TIMER4C_ENABLED && defined TIMER4_COMPC_vect +DEFINE_OC_INTR(TIMER4_COMPC_vect) #endif /*************************/ -#if defined TIMER5_ENABLED && defined SIG_OVERFLOW5 -DEFINE_OV_INTR(SIG_OVERFLOW5) +#if defined TIMER5_ENABLED && defined TIMER5_OVF_vect +DEFINE_OV_INTR(TIMER5_OVF_vect) #endif -#if defined TIMER5A_ENABLED && defined SIG_OUTPUT_COMPARE5A -DEFINE_OC_INTR(SIG_OUTPUT_COMPARE5A) +#if defined TIMER5A_ENABLED && defined TIMER5_COMPA_vect +DEFINE_OC_INTR(TIMER5_COMPA_vect) #endif -#if defined TIMER5B_ENABLED && defined SIG_OUTPUT_COMPARE5B -DEFINE_OC_INTR(SIG_OUTPUT_COMPARE5B) +#if defined TIMER5B_ENABLED && defined TIMER5_COMPB_vect +DEFINE_OC_INTR(TIMER5_COMPB_vect) #endif -#if defined TIMER5C_ENABLED && defined SIG_OUTPUT_COMPARE5C -DEFINE_OC_INTR(SIG_OUTPUT_COMPARE5C) +#if defined TIMER5C_ENABLED && defined TIMER5_COMPC_vect +DEFINE_OC_INTR(TIMER5_COMPC_vect) #endif /*************************/ void timer_intr_init(void) { - memset((void*)timer_OV_callback_table, 0, sizeof(timer_OV_callback_table)); - memset((void*)timer_OC_callback_table, 0, sizeof(timer_OC_callback_table)); + memset((void*)timer_callback_table, 0, sizeof(timer_callback_table)); } - - diff --git a/modules/hardware/timer/timer_intr.h b/modules/hardware/timer/timer_intr.h index e14afb6..f3ff78e 100644 --- a/modules/hardware/timer/timer_intr.h +++ b/modules/hardware/timer/timer_intr.h @@ -23,8 +23,7 @@ typedef void (*timer_callback_t)(void); -extern volatile timer_callback_t timer_OV_callback_table[SIG_OVERFLOW_TOTAL_NUM]; -extern volatile timer_callback_t timer_OC_callback_table[SIG_OUTPUT_COMPARE_TOTAL_NUM]; +extern volatile timer_callback_t timer_callback_table[_VECTORS_SIZE/4]; /* initialisation of callback table */ void timer_intr_init(void);