[En-Nut-Discussion] AVR: SIG_ is deprecated
Uwe Bonnes
bon at elektron.ikp.physik.tu-darmstadt.de
Fri Sep 7 17:51:09 CEST 2012
>>>>> "Harald" == Harald Kipp <harald.kipp at egnite.de> writes:
Harald> On 07.09.2012 11:52, Uwe Bonnes wrote:
>> So if I don't hear any objections, I will replace all AVR SIG_*
>> vector references with the *_vect style.
Harald> Good idea.
Okay,
find appended the diff to do so. Avr-libc names the _vect entries as they
are named in the datasheet. The datasheets for different devices uses
different names, and so the definitions in the header files are different.
For the deprecated SIG_ name, some parts already used different names. So to
make the ethernut code cope with as many parts as possible, I define e.g.
USART0_TX_vect to USART0_TX_vect or UART0_TX_vect or UART_TX_vect whichever
is available and later use only USART0_TX_vect.
But as differences in the names are only slight, i appreciate if somebody
gives me a code review. I however successfull compiled some AVR configs up
to the examples. If the "code review" should happen inside SVN, please let me
know too.
Bye
B.t.w. in recent avr-libc I didn't find SIG_EEPROM as used in
dev/ih_ee_ready.c, so I left that code path untouched.
--
Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Index: dev/ih_adc.c
===================================================================
--- dev/ih_adc.c (Revision 4548)
+++ dev/ih_adc.c (Arbeitskopie)
@@ -163,12 +163,12 @@
return rc;
}
-/*! \fn SIG_ADC(void)
+/*! \fn ADC_vect(void)
* \brief ADC conversion complete interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_ADC:iv_ADC
+#pragma interrupt_handler ADC_vect:iv_ADC
#endif
-NUTSIGNAL(SIG_ADC, sig_ADC)
+NUTSIGNAL(ADC_vect, sig_ADC)
/*@}*/
Index: dev/ih_analog_comp.c
===================================================================
--- dev/ih_analog_comp.c (Revision 4548)
+++ dev/ih_analog_comp.c (Arbeitskopie)
@@ -162,13 +162,20 @@
}
return rc;
}
+/* avr-libc names the vector as in the datasheets. As Atmel naming is
+ * inconsistant, so is the avr-libc naming.
+ * Equalize!
+ */
+#if !defined(ANALOG_COMP_vect) && defined(ANA_COMP_vect)
+#define ANALOG_COMP_vect ANA_COMP_vect
+#endif
-/*! \fn SIG_COMPARATOR(void)
+/*! \fn ANA_COMP_vect(void)
* \brief Analog comparator interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_COMPARATOR:iv_ANALOG_COMP
+#pragma interrupt_handler ANALOG_COMP_vect:iv_ANALOG_COMP
#endif
-NUTSIGNAL(SIG_COMPARATOR, sig_COMPARATOR)
+NUTSIGNAL(ANALOG_COMP_vect, sig_COMPARATOR)
/*@}*/
Index: dev/ih_canit.c
===================================================================
--- dev/ih_canit.c (Revision 4548)
+++ dev/ih_canit.c (Arbeitskopie)
@@ -78,7 +78,7 @@
*/
/*@{*/
-#if defined(SIG_CAN_INTERRUPT1) || defined(iv_CAN_TRANSFER)
+#if defined(CANIT_vect) || defined(iv_CAN_TRANSFER)
static int AvrCanTxIrqCtl(int cmd, void *param);
@@ -137,12 +137,12 @@
return rc;
}
-/*! \fn SIG_CAN_INTERRUPT1(void)
+/*! \fn CANIT_vect(void)
* \brief CAN serial transfer interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_CAN_INTERRUPT1:iv_CAN_TRANSFER
+#pragma interrupt_handler CANIT_vect:iv_CAN_TRANSFER
#endif
-NUTSIGNAL(SIG_CAN_INTERRUPT1, sig_CAN_TRANSFER)
+NUTSIGNAL(CANIT_vect, sig_CAN_TRANSFER)
#endif
/*@}*/
Index: dev/ih_ee_ready.c
===================================================================
--- dev/ih_ee_ready.c (Revision 4548)
+++ dev/ih_ee_ready.c (Arbeitskopie)
@@ -146,15 +146,23 @@
return rc;
}
-#if defined(SIG_EEPROM_READY) || defined(iv_EE_READY)
+/* avr-libc names the vector as in the datasheets. As Atmel naming is
+ * inconsistant, so is the avr-libc naming.
+ * Equalize!
+ */
+#if !defined(EE_READY_vect) && defined(EE_RDY_vect)
+#define EE_READY_vect EE_RDY_vect
+#endif
-/*! \fn SIG_EEPROM_READY(void)
+#if defined(EE_READY_vect) || defined(iv_EE_READY)
+
+/*! \fn EE_READY_vect(void)
* \brief EEPROM ready interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_EEPROM_READY:iv_EE_READY
+#pragma interrupt_handler EE_READY_vect:iv_EE_READY
#endif
-NUTSIGNAL(SIG_EEPROM_READY, sig_EEPROM_READY)
+NUTSIGNAL(EE_READY_vect, sig_EEPROM_READY)
#else
/*! \fn SIG_EEPROM(void)
Index: dev/ih_int0.c
===================================================================
--- dev/ih_int0.c (Revision 4548)
+++ dev/ih_int0.c (Arbeitskopie)
@@ -209,12 +209,12 @@
}
/*!
- * \fn SIG_INTERRUPT0(void)
+ * \fn INT0_vect(void)
* \brief External interrupt 0 entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_INTERRUPT0:iv_INT0
+#pragma interrupt_handler INT0_vect:iv_INT0
#endif
-NUTSIGNAL(SIG_INTERRUPT0, sig_INTERRUPT0)
+NUTSIGNAL(INT0_vect, sig_INTERRUPT0)
/*@}*/
Index: dev/ih_int1.c
===================================================================
--- dev/ih_int1.c (Revision 4548)
+++ dev/ih_int1.c (Arbeitskopie)
@@ -207,12 +207,12 @@
return rc;
}
-/*! \fn SIG_INTERRUPT1(void)
+/*! \fn INT1_vect(void)
* \brief External interrupt 1 entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_INTERRUPT1:iv_INT1
+#pragma interrupt_handler INT1_vect:iv_INT1
#endif
-NUTSIGNAL(SIG_INTERRUPT1, sig_INTERRUPT1)
+NUTSIGNAL(INT1_vect, sig_INTERRUPT1)
/*@}*/
Index: dev/ih_int2.c
===================================================================
--- dev/ih_int2.c (Revision 4548)
+++ dev/ih_int2.c (Arbeitskopie)
@@ -207,13 +207,13 @@
return rc;
}
-/*! \fn SIG_INTERRUPT2(void)
+/*! \fn INT2_vect(void)
* \brief External interrupt 2 entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_INTERRUPT2:iv_INT2
+#pragma interrupt_handler INT2_vect:iv_INT2
#endif
-NUTSIGNAL(SIG_INTERRUPT2, sig_INTERRUPT2)
+NUTSIGNAL(INT2_vect, sig_INTERRUPT2)
/*@}*/
Index: dev/ih_int3.c
===================================================================
--- dev/ih_int3.c (Revision 4548)
+++ dev/ih_int3.c (Arbeitskopie)
@@ -207,12 +207,12 @@
return rc;
}
-/*! \fn SIG_INTERRUPT3(void)
+/*! \fn INT3_vect(void)
* \brief External interrupt 3 entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_INTERRUPT3:iv_INT3
+#pragma interrupt_handler INT3_vect:iv_INT3
#endif
-NUTSIGNAL(SIG_INTERRUPT3, sig_INTERRUPT3)
+NUTSIGNAL(INT3_vect, sig_INTERRUPT3)
/*@}*/
Index: dev/ih_int4.c
===================================================================
--- dev/ih_int4.c (Revision 4548)
+++ dev/ih_int4.c (Arbeitskopie)
@@ -193,13 +193,13 @@
return rc;
}
-/*! \fn SIG_INTERRUPT4(void)
+/*! \fn INT4_vect(void)
* \brief External interrupt 4 entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_INTERRUPT4:iv_INT4
+#pragma interrupt_handler INT4_vect:iv_INT4
#endif
-NUTSIGNAL(SIG_INTERRUPT4, sig_INTERRUPT4)
+NUTSIGNAL(INT4_vect, sig_INTERRUPT4)
/*@}*/
Index: dev/ih_int5.c
===================================================================
--- dev/ih_int5.c (Revision 4548)
+++ dev/ih_int5.c (Arbeitskopie)
@@ -193,13 +193,13 @@
return rc;
}
-/*! \fn SIG_INTERRUPT5(void)
+/*! \fn INT5_vect(void)
* \brief External interrupt 5 entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_INTERRUPT5:iv_INT5
+#pragma interrupt_handler INT5_vect:iv_INT5
#endif
-NUTSIGNAL(SIG_INTERRUPT5, sig_INTERRUPT5)
+NUTSIGNAL(INT5_vect, sig_INTERRUPT5)
/*@}*/
Index: dev/ih_int6.c
===================================================================
--- dev/ih_int6.c (Revision 4548)
+++ dev/ih_int6.c (Arbeitskopie)
@@ -193,12 +193,12 @@
return rc;
}
-/*! \fn SIG_INTERRUPT6(void)
+/*! \fn INT6_vect(void)
* \brief External interrupt 6 entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_INTERRUPT6:iv_INT6
+#pragma interrupt_handler INT6_vect:iv_INT6
#endif
-NUTSIGNAL(SIG_INTERRUPT6, sig_INTERRUPT6)
+NUTSIGNAL(INT6_vect, sig_INTERRUPT6)
/*@}*/
Index: dev/ih_int7.c
===================================================================
--- dev/ih_int7.c (Revision 4548)
+++ dev/ih_int7.c (Arbeitskopie)
@@ -193,13 +193,13 @@
return rc;
}
-/*! \fn SIG_INTERRUPT7(void)
+/*! \fn INT7_vect(void)
* \brief External interrupt 7 entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_INTERRUPT7:iv_INT7
+#pragma interrupt_handler INT7_vect:iv_INT7
#endif
-NUTSIGNAL(SIG_INTERRUPT7, sig_INTERRUPT7)
+NUTSIGNAL(INT7_vect, sig_INTERRUPT7)
/*@}*/
Index: dev/ih_ovrit.c
===================================================================
--- dev/ih_ovrit.c (Revision 4551)
+++ dev/ih_ovrit.c (Arbeitskopie)
@@ -78,7 +78,7 @@
*/
/*@{*/
-#if defined(SIG_CAN_OVERFLOW1) || defined(iv_CAN_TIM_OVR)
+#if defined(OVRIT_vect) || defined(iv_CAN_TIM_OVR)
static int AvrCanOvrIrqCtl(int cmd, void *param);
@@ -137,12 +137,12 @@
return rc;
}
-/*! \fn SIG_CAN_OVERFLOW1(void)
+/*! \fn OVRIT_vect(void)
* \brief CAN overflow interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_CAN_OVERFLOW1:iv_CAN_TIM_OVR
+#pragma interrupt_handler OVRIT_vect:iv_CAN_TIM_OVR
#endif
-NUTSIGNAL(SIG_CAN_OVERFLOW1, sig_CAN_OVERRUN)
+NUTSIGNAL(OVRIT_vect, sig_CAN_OVERRUN)
#endif
/*@}*/
Index: dev/ih_spi_stc.c
===================================================================
--- dev/ih_spi_stc.c (Revision 4548)
+++ dev/ih_spi_stc.c (Arbeitskopie)
@@ -159,13 +159,13 @@
return rc;
}
-/*! \fn SIG_SPI(void)
+/*! \fn SPI_STC_vect(void)
* \brief SPI interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_SPI:iv_SPI_STC
+#pragma interrupt_handler SPI_STC_vect:iv_SPI_STC
#endif
-NUTSIGNAL(SIG_SPI, sig_SPI)
+NUTSIGNAL(SPI_STC_vect, sig_SPI)
/*@}*/
Index: dev/ih_spm_ready.c
===================================================================
--- dev/ih_spm_ready.c (Revision 4548)
+++ dev/ih_spm_ready.c (Arbeitskopie)
@@ -84,8 +84,16 @@
*/
/*@{*/
-#if defined(SIG_SPM_READY) || defined(iv_SPM_READY)
+/* avr-libc names the vector as in the datasheets. As Atmel naming is
+ * inconsistant, so is the avr-libc naming.
+ * Equalize!
+ */
+#if !defined(SPM_READY_vect) && defined(SPM_RDY_vect)
+#define SPM_READY_vect SPM_RDY_vect
+#endif
+#if defined(SPM_READY_vect) || defined(iv_SPM_READY)
+
static int AvrSpmRdyIrqCtl(int cmd, void *param);
IRQ_HANDLER sig_SPM_READY = {
@@ -148,12 +156,12 @@
return rc;
}
-/*! \fn SIG_SPM_READY(void)
+/*! \fn SPM_RDY_vect(void)
* \brief Store program memory interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_SPM_READY:iv_SPM_READY
+#pragma interrupt_handler SPM_READY_vect:iv_SPM_READY
#endif
-NUTSIGNAL(SIG_SPM_READY, sig_SPM_READY)
+NUTSIGNAL(SPM_READY_vect, sig_SPM_READY)
#endif
/*@}*/
Index: dev/ih_timer0_comp.c
===================================================================
--- dev/ih_timer0_comp.c (Revision 4548)
+++ dev/ih_timer0_comp.c (Arbeitskopie)
@@ -185,21 +185,21 @@
return rc;
}
-/*! \fn SIG_OUTPUT_COMPARE0(void)
+/*! \fn TIMER0_COMP_vect(void)
* \brief Timer 0 output compare interrupt entry.
*/
#ifdef __IMAGECRAFT__
#if defined( ATMega2560 ) || defined( ATMega2561 )
-#pragma interrupt_handler SIG_OUTPUT_COMPARE0:iv_TIMER0_COMPA
+#pragma interrupt_handler TIMER0_COMP_vect:iv_TIMER0_COMPA
#else
-#pragma interrupt_handler SIG_OUTPUT_COMPARE0:iv_TIMER0_COMP
+#pragma interrupt_handler TIMER0_COMP_vect:iv_TIMER0_COMP
#endif
-NUTSIGNAL(SIG_OUTPUT_COMPARE0, sig_OUTPUT_COMPARE0)
+NUTSIGNAL(TIMER0_COMP_vect, sig_OUTPUT_COMPARE0)
#else
#if defined(MCU_ATMEGA2560) || defined(MCU_ATMEGA2561)
-NUTSIGNAL(SIG_OUTPUT_COMPARE0A, sig_OUTPUT_COMPARE0)
+NUTSIGNAL(TIMER0_COMPA_vect, sig_OUTPUT_COMPARE0)
#else
-NUTSIGNAL(SIG_OUTPUT_COMPARE0, sig_OUTPUT_COMPARE0)
+NUTSIGNAL(TIMER0_COMP_vect, sig_OUTPUT_COMPARE0)
#endif
#endif
Index: dev/ih_timer0_ovf.c
===================================================================
--- dev/ih_timer0_ovf.c (Revision 4548)
+++ dev/ih_timer0_ovf.c (Arbeitskopie)
@@ -160,13 +160,13 @@
return rc;
}
-/*! \fn SIG_OVERFLOW0(void)
+/*! \fn TIMER0_OVF_vect(void)
* \brief Timer 0 overflow interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_OVERFLOW0:iv_TIMER0_OVF
+#pragma interrupt_handler TIMER0_OVF_vect:iv_TIMER0_OVF
#endif
-NUTSIGNAL(SIG_OVERFLOW0, sig_OVERFLOW0)
+NUTSIGNAL(TIMER0_OVF_vect, sig_OVERFLOW0)
/*@}*/
Index: dev/ih_timer1_capt.c
===================================================================
--- dev/ih_timer1_capt.c (Revision 4548)
+++ dev/ih_timer1_capt.c (Arbeitskopie)
@@ -181,13 +181,13 @@
return rc;
}
-/*! \fn SIG_INPUT_CAPTURE1(void)
+/*! \fn TIMER1_CAPT_vect(void)
* \brief Timer 1 input capture interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_INPUT_CAPTURE1:iv_TIMER1_CAPT
+#pragma interrupt_handler TIMER1_CAPT_vect:iv_TIMER1_CAPT
#endif
-NUTSIGNAL(SIG_INPUT_CAPTURE1, sig_INPUT_CAPTURE1)
+NUTSIGNAL(TIMER1_CAPT_vect, sig_INPUT_CAPTURE1)
/*@}*/
Index: dev/ih_timer1_compa.c
===================================================================
--- dev/ih_timer1_compa.c (Revision 4548)
+++ dev/ih_timer1_compa.c (Arbeitskopie)
@@ -160,13 +160,13 @@
return rc;
}
-/*! \fn SIG_OUTPUT_COMPARE1A(void)
+/*! \fn TIMER1_COMPA_vect(void)
* \brief Timer 1A output compare interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_OUTPUT_COMPARE1A:iv_TIMER1_COMPA
+#pragma interrupt_handler TIMER1_COMPA_vect:iv_TIMER1_COMPA
#endif
-NUTSIGNAL(SIG_OUTPUT_COMPARE1A, sig_OUTPUT_COMPARE1A)
+NUTSIGNAL(TIMER1_COMPA_vect, sig_OUTPUT_COMPARE1A)
/*@}*/
Index: dev/ih_timer1_compb.c
===================================================================
--- dev/ih_timer1_compb.c (Revision 4548)
+++ dev/ih_timer1_compb.c (Arbeitskopie)
@@ -160,13 +160,13 @@
return rc;
}
-/*! \fn SIG_OUTPUT_COMPARE1B(void)
+/*! \fn TIMER1_COMPB_vect(void)
* \brief Timer 1B output compare interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_OUTPUT_COMPARE1B:iv_TIMER1_COMPB
+#pragma interrupt_handler TIMER1_COMPB_vect:iv_TIMER1_COMPB
#endif
-NUTSIGNAL(SIG_OUTPUT_COMPARE1B, sig_OUTPUT_COMPARE1B)
+NUTSIGNAL(TIMER1_COMPB_vect, sig_OUTPUT_COMPARE1B)
/*@}*/
Index: dev/ih_timer1_compc.c
===================================================================
--- dev/ih_timer1_compc.c (Revision 4548)
+++ dev/ih_timer1_compc.c (Arbeitskopie)
@@ -105,7 +105,7 @@
*/
/*@{*/
-#if defined(SIG_OUTPUT_COMPARE1C) || defined(iv_TIMER1_COMPC)
+#if defined(TIMER1_COMPC_vect) || defined(iv_TIMER1_COMPC)
static int AvrTimer1CompCIrqCtl(int cmd, void *param);
@@ -186,12 +186,12 @@
return rc;
}
-/*! \fn SIG_OUTPUT_COMPARE1C(void)
+/*! \fn TIMER1_COMPC_vect(void)
* \brief Timer 1C output compare interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_OUTPUT_COMPARE1C:iv_TIMER1_COMPC
+#pragma interrupt_handler TIMER1_COMPC_vect:iv_TIMER1_COMPC
#endif
-NUTSIGNAL(SIG_OUTPUT_COMPARE1C, sig_OUTPUT_COMPARE1C)
+NUTSIGNAL(TIMER1_COMPC_vect, sig_OUTPUT_COMPARE1C)
#endif
/*@}*/
Index: dev/ih_timer1_ovf.c
===================================================================
--- dev/ih_timer1_ovf.c (Revision 4548)
+++ dev/ih_timer1_ovf.c (Arbeitskopie)
@@ -160,13 +160,13 @@
return rc;
}
-/*! \fn SIG_OVERFLOW1(void)
+/*! \fn TIMER1_OVF_vect(void)
* \brief Timer 1 overflow interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_OVERFLOW1:iv_TIMER1_OVF
+#pragma interrupt_handler TIMER1_OVF_vect:iv_TIMER1_OVF
#endif
-NUTSIGNAL(SIG_OVERFLOW1, sig_OVERFLOW1)
+NUTSIGNAL(TIMER1_OVF_vect, sig_OVERFLOW1)
/*@}*/
Index: dev/ih_timer2_comp.c
===================================================================
--- dev/ih_timer2_comp.c (Revision 4548)
+++ dev/ih_timer2_comp.c (Arbeitskopie)
@@ -185,21 +185,21 @@
return rc;
}
-/*! \fn SIG_OUTPUT_COMPARE2(void)
+/*! \fn TIMER2_COMP_vect(void)
* \brief Timer 2 output compare interrupt entry.
*/
#ifdef __IMAGECRAFT__
#if defined(ATMega2560) || defined(ATMega2561)
-#pragma interrupt_handler SIG_OUTPUT_COMPARE2:iv_TIMER2_COMPA
+#pragma interrupt_handler TIMER2_COMP_vect:iv_TIMER2_COMPA
#else
-#pragma interrupt_handler SIG_OUTPUT_COMPARE2:iv_TIMER2_COMP
+#pragma interrupt_handler TIMER2_COMP_vect:iv_TIMER2_COMP
#endif
-NUTSIGNAL(SIG_OUTPUT_COMPARE2, sig_OUTPUT_COMPARE2)
+NUTSIGNAL(TIMER2_COMP_vect, sig_OUTPUT_COMPARE2)
#else
#if defined(MCU_ATMEGA2560) || defined(MCU_ATMEGA2561)
-NUTSIGNAL(SIG_OUTPUT_COMPARE2A, sig_OUTPUT_COMPARE2)
+NUTSIGNAL(TIMER2_COMPA_vect, sig_OUTPUT_COMPARE2)
#else
-NUTSIGNAL(SIG_OUTPUT_COMPARE2, sig_OUTPUT_COMPARE2)
+NUTSIGNAL(TIMER2_COMP_vect, sig_OUTPUT_COMPARE2)
#endif
#endif
Index: dev/ih_timer2_ovf.c
===================================================================
--- dev/ih_timer2_ovf.c (Revision 4548)
+++ dev/ih_timer2_ovf.c (Arbeitskopie)
@@ -160,12 +160,12 @@
return rc;
}
-/*! \fn SIG_OVERFLOW2(void)
+/*! \fn TIMER2_OVF_vect(void)
* \brief Timer 2 overflow interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_OVERFLOW2:iv_TIMER2_OVF
+#pragma interrupt_handler TIMER2_OVF_vect:iv_TIMER2_OVF
#endif
-NUTSIGNAL(SIG_OVERFLOW2, sig_OVERFLOW2)
+NUTSIGNAL(TIMER2_OVF_vect, sig_OVERFLOW2)
/*@}*/
Index: dev/ih_timer3_capt.c
===================================================================
--- dev/ih_timer3_capt.c (Revision 4548)
+++ dev/ih_timer3_capt.c (Arbeitskopie)
@@ -108,7 +108,7 @@
*/
/*@{*/
-#if defined(SIG_INPUT_CAPTURE3) || defined(iv_TIMER3_CAPT)
+#if defined(TIMER3_CAPT_vect) || defined(iv_TIMER3_CAPT)
static int AvrTimer3InCaptIrqCtl(int cmd, void *param);
@@ -187,12 +187,12 @@
return rc;
}
-/*! \fn SIG_INPUT_CAPTURE3(void)
+/*! \fn TIMER3_CAPT_vect(void)
* \brief Timer 3 input capture interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_INPUT_CAPTURE3:iv_TIMER3_CAPT
+#pragma interrupt_handler TIMER3_CAPT_vect:iv_TIMER3_CAPT
#endif
-NUTSIGNAL(SIG_INPUT_CAPTURE3, sig_INPUT_CAPTURE3)
+NUTSIGNAL(TIMER3_CAPT_vect, sig_INPUT_CAPTURE3)
#endif
/*@}*/
Index: dev/ih_timer3_compa.c
===================================================================
--- dev/ih_timer3_compa.c (Revision 4548)
+++ dev/ih_timer3_compa.c (Arbeitskopie)
@@ -105,7 +105,7 @@
*/
/*@{*/
-#if defined(SIG_OUTPUT_COMPARE3A) || defined(iv_TIMER3_COMPA)
+#if defined(TIMER3_COMPA_vect) || defined(iv_TIMER3_COMPA)
static int AvrTimer3CompAIrqCtl(int cmd, void *param);
@@ -186,12 +186,12 @@
return rc;
}
-/*! \fn SIG_OUTPUT_COMPARE3A(void)
+/*! \fn TIMER3_COMPA_vect(void)
* \brief Timer 3A output compare interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_OUTPUT_COMPARE3A:iv_TIMER3_COMPA
+#pragma interrupt_handler TIMER3_COMPA_vect:iv_TIMER3_COMPA
#endif
-NUTSIGNAL(SIG_OUTPUT_COMPARE3A, sig_OUTPUT_COMPARE3A)
+NUTSIGNAL(TIMER3_COMPA_vect, sig_OUTPUT_COMPARE3A)
#endif
/*@}*/
Index: dev/ih_timer3_compb.c
===================================================================
--- dev/ih_timer3_compb.c (Revision 4548)
+++ dev/ih_timer3_compb.c (Arbeitskopie)
@@ -105,7 +105,7 @@
*/
/*@{*/
-#if defined(SIG_OUTPUT_COMPARE3B) || defined(iv_TIMER3_COMPB)
+#if defined(TIMER3_COMPB_vect) || defined(iv_TIMER3_COMPB)
static int AvrTimer3CompBIrqCtl(int cmd, void *param);
@@ -186,12 +186,12 @@
return rc;
}
-/*! \fn SIG_OUTPUT_COMPARE3B(void)
+/*! \fn TIMER3_COMPB_vect(void)
* \brief Timer 3B output compare interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_OUTPUT_COMPARE3B:iv_TIMER3_COMPB
+#pragma interrupt_handler TIMER3_COMPB_vect:iv_TIMER3_COMPB
#endif
-NUTSIGNAL(SIG_OUTPUT_COMPARE3B, sig_OUTPUT_COMPARE3B)
+NUTSIGNAL(TIMER3_COMPB_vect, sig_OUTPUT_COMPARE3B)
#endif
/*@}*/
Index: dev/ih_timer3_compc.c
===================================================================
--- dev/ih_timer3_compc.c (Revision 4548)
+++ dev/ih_timer3_compc.c (Arbeitskopie)
@@ -105,7 +105,7 @@
*/
/*@{*/
-#if defined(SIG_OUTPUT_COMPARE3C) || defined(iv_TIMER3_COMPC)
+#if defined(TIMER3_COMPC_vect) || defined(iv_TIMER3_COMPC)
static int AvrTimer3CompCIrqCtl(int cmd, void *param);
@@ -186,12 +186,12 @@
return rc;
}
-/*! \fn SIG_OUTPUT_COMPARE3C(void)
+/*! \fn TIMER3_COMPC_vect(void)
* \brief Timer 3C output compare interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_OUTPUT_COMPARE3C:iv_TIMER3_COMPC
+#pragma interrupt_handler TIMER3_COMPC_vect:iv_TIMER3_COMPC
#endif
-NUTSIGNAL(SIG_OUTPUT_COMPARE3C, sig_OUTPUT_COMPARE3C)
+NUTSIGNAL(TIMER3_COMPC_vect, sig_OUTPUT_COMPARE3C)
#endif
/*@}*/
Index: dev/ih_timer3_ovf.c
===================================================================
--- dev/ih_timer3_ovf.c (Revision 4548)
+++ dev/ih_timer3_ovf.c (Arbeitskopie)
@@ -105,7 +105,7 @@
*/
/*@{*/
-#if defined(SIG_OVERFLOW3) || defined(iv_TIMER3_OVF)
+#if defined(TIMER3_OVF_vect) || defined(iv_TIMER3_OVF)
static int AvrTimer3OvfIrqCtl(int cmd, void *param);
@@ -186,12 +186,12 @@
return rc;
}
-/*! \fn SIG_OVERFLOW3(void)
+/*! \fn TIMER3_OVF_vect(void)
* \brief Timer 3 overflow interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_OVERFLOW3:iv_TIMER3_OVF
+#pragma interrupt_handler TIMER3_OVF_vect:iv_TIMER3_OVF
#endif
-NUTSIGNAL(SIG_OVERFLOW3, sig_OVERFLOW3)
+NUTSIGNAL(TIMER3_OVF_vect, sig_OVERFLOW3)
#endif
/*@}*/
Index: dev/ih_twi.c
===================================================================
--- dev/ih_twi.c (Revision 4548)
+++ dev/ih_twi.c (Arbeitskopie)
@@ -80,7 +80,7 @@
*/
/*@{*/
-#if defined(SIG_2WIRE_SERIAL) || defined(iv_TWI)
+#if defined(TWI_vect) || defined(iv_TWI)
static int AvrTwiIrqCtl(int cmd, void *param);
@@ -164,12 +164,12 @@
return rc;
}
-/*! \fn SIG_2WIRE_SERIAL(void)
+/*! \fn TWI_vect(void)
* \brief Two-wire serial interface interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_2WIRE_SERIAL:iv_TWI
+#pragma interrupt_handler TWI_vect:iv_TWI
#endif
-NUTSIGNAL(SIG_2WIRE_SERIAL, sig_2WIRE_SERIAL)
+NUTSIGNAL(TWI_vect, sig_2WIRE_SERIAL)
#endif
/*@}*/
Index: dev/ih_usart0_rx.c
===================================================================
--- dev/ih_usart0_rx.c (Revision 4548)
+++ dev/ih_usart0_rx.c (Arbeitskopie)
@@ -171,27 +171,25 @@
return rc;
}
-#if defined(SIG_UART0_RECV) || defined(iv_USART0_RX)
-
-/*! \fn SIG_UART0_RECV(void)
- * \brief Uart0 receive complete interrupt entry.
+/* avr-libc names the vector as in the datasheets. As Atmel naming is
+ * inconsistant, so is the avr-libc naming.
+ * Equalize!
*/
-#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_UART0_RECV:iv_USART0_RX
+#if !defined(USART0_RX_vect) && defined( UART0_RX_vect)
+#define USART0_RX_vect UART0_RX_vect
+#elif !defined(USART0_RX_vect) && ddefined(UART_RX_vect)
+#define USART0_RX_vect UART_RX_vect
#endif
-NUTSIGNAL(SIG_UART0_RECV, sig_UART0_RECV)
-#elif defined(SIG_USART0_RECV)
-NUTSIGNAL(SIG_USART0_RECV, sig_UART0_RECV)
-
-#else
-
-/*! \fn SIG_UART_RECV(void)
+/*! \fn UART0_RX_vect(void)
* \brief Uart0 receive complete interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_UART_RECV:iv_UART_RX
+#if defined(iv_USART0_RX)
+#pragma interrupt_handler USART0_RX_vect:iv_USART0_RX
+#else
+#pragma interrupt_handler USART0_RX_vect:iv_UART_RX
#endif
-NUTSIGNAL(SIG_UART_RECV, sig_UART0_RECV)
#endif
+NUTSIGNAL(USART0_RX_vect, sig_UART0_RECV)
/*@}*/
Index: dev/ih_usart0_tx.c
===================================================================
--- dev/ih_usart0_tx.c (Revision 4548)
+++ dev/ih_usart0_tx.c (Arbeitskopie)
@@ -173,27 +173,25 @@
return rc;
}
-#if defined(SIG_UART0_TRANS) || defined(iv_USART0_TX)
-
-/*! \fn SIG_UART0_TRANS(void)
- * \brief Uart0 transmit complete interrupt entry.
+/* avr-libc names the vector as in the datasheets. As Atmel naming is
+ * inconsistant, so is the avr-libc naming.
+ * Equalize!
*/
-#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_UART0_TRANS:iv_USART0_TX
+#if !defined(USART0_TX_vect) && defined( UART0_TX_vect)
+#define USART0_TX_vect UART0_TX_vect
+#elif !defined(USART0_TX_vect) && ddefined(UART_TX_vect)
+#define USART0_TX_vect UART_TX_vect
#endif
-NUTSIGNAL(SIG_UART0_TRANS, sig_UART0_TRANS)
-#elif defined(SIG_USART0_TRANS)
-NUTSIGNAL(SIG_USART0_TRANS, sig_UART0_TRANS)
-
-#else
-
-/*! \fn SIG_UART_TRANS(void)
- * \brief Uart0 transmit complete interrupt entry.
+/*! \fn UART0_TX_vect(void)
+ * \brief Uart0 receive complete interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_UART_TRANS:iv_UART_TX
+#if defined(iv_USART0_TX)
+#pragma interrupt_handler USART0_TX_vect:iv_USART0_TX
+#else
+#pragma interrupt_handler USART0_TX_vect:iv_UART_TX
#endif
-NUTSIGNAL(SIG_UART_TRANS, sig_UART0_TRANS)
#endif
+NUTSIGNAL(USART0_TX_vect, sig_UART0_TRANS)
/*@}*/
Index: dev/ih_usart0_udre.c
===================================================================
--- dev/ih_usart0_udre.c (Revision 4548)
+++ dev/ih_usart0_udre.c (Arbeitskopie)
@@ -170,27 +170,28 @@
return rc;
}
-#if defined(SIG_UART0_DATA) || defined(iv_USART0_UDRE)
-
-/*! \fn SIG_UART0_DATA(void)
- * \brief Uart0 data register empty interrupt entry.
+/* avr-libc names the vector as in the datasheets. As Atmel naming is
+ * inconsistant, so is the avr-libc naming.
+ * Equalize!
*/
-#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_UART0_DATA:iv_USART0_UDRE
+#if !defined(USART0_UDRE_vect) && defined(UART0_UDRE_vect)
+#define USART0_UDRE_vect UART0_UDRE_vect
+#elif !defined(USART0_UDRE_vect) && defined(UART_UDRE_vect)
+#define USART0_UDRE_vect UART_UDRE_vect
#endif
-NUTSIGNAL(SIG_UART0_DATA, sig_UART0_DATA)
-#elif defined(SIG_USART0_DATA)
+#endif
-NUTSIGNAL(SIG_USART0_DATA, sig_USART0_DATA)
-
-#else
-
-/*! \fn SIG_UART_DATA(void)
+/*! \fn sig_UART0_DATA(void)
* \brief Uart0 data register empty interrupt entry.
*/
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_UART_DATA:iv_UART_UDRE
+#if defined(iv_USART0_UDRE)
+#pragma interrupt_handler USART0_UDRE_vect:iv_USART0_UDRE
+#else
+#pragma interrupt_handler USART0_UDRE_vect:iv_UART_UDRE
#endif
-NUTSIGNAL(SIG_UART_DATA, sig_UART0_DATA)
#endif
+
+NUTSIGNAL(USART0_UDRE_vect, sig_UART0_DATA)
+
/*@}*/
Index: dev/ih_usart1_rx.c
===================================================================
--- dev/ih_usart1_rx.c (Revision 4548)
+++ dev/ih_usart1_rx.c (Arbeitskopie)
@@ -84,8 +84,16 @@
*/
/*@{*/
-#if defined(SIG_UART1_RECV) || defined(iv_USART1_RX) || defined(SIG_USART1_RECV)
+/* avr-libc names the vector as in the datasheets. As Atmel naming is
+ * inconsistant, so is the avr-libc naming.
+ * Equalize!
+ */
+#if !defined(USART1_RX_vect) && defined(UART1_RX_vect)
+#define USART1_RX_vect UART1_RX_vect
+#endif
+#if defined(USART1_RX_vect) || defined(iv_USART1_RX)
+
static int AvrUart1RxIrqCtl(int cmd, void *param);
IRQ_HANDLER sig_UART1_RECV = {
@@ -167,17 +175,13 @@
return rc;
}
-/*! \fn SIG_UART1_RECV(void)
+/*! \fn sig_UART1_RECV(void)
* \brief Uart0 receive complete interrupt entry.
*/
-#if defined(SIG_UART1_RECV) || defined(iv_USART1_RX)
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_UART1_RECV:iv_USART1_RX
+#pragma interrupt_handler USART1_RX_vect:iv_USART1_RX
#endif
-NUTSIGNAL(SIG_UART1_RECV, sig_UART1_RECV)
-#elif defined(SIG_USART1_RECV)
-NUTSIGNAL(SIG_USART1_RECV, sig_UART1_RECV)
-#endif
+NUTSIGNAL(USART1_RX_vect, sig_UART1_RECV)
#endif
/*@}*/
Index: dev/ih_usart1_tx.c
===================================================================
--- dev/ih_usart1_tx.c (Revision 4548)
+++ dev/ih_usart1_tx.c (Arbeitskopie)
@@ -91,8 +91,16 @@
*/
/*@{*/
-#if defined(SIG_UART1_TRANS) || defined(iv_USART1_TX) || defined(SIG_USART1_TRANS)
+/* avr-libc names the vector as in the datasheets. As Atmel naming is
+ * inconsistant, so is the avr-libc naming.
+ * Equalize!
+ */
+#if !defined(USART1_TX_vect) && defined(UART1_TX_vect)
+#define USART1_TX_vect UART1_TX_vect
+#endif
+#if defined(USART1_TX_vect) || defined(iv_USART1_TX)
+
static int AvrUart1TxIrqCtl(int cmd, void *param);
IRQ_HANDLER sig_UART1_TRANS = {
@@ -172,17 +180,13 @@
return rc;
}
-/*! \fn SIG_UART1_TRANS(void)
+/*! \fn sig_UART1_TRANS(void)
* Uart1 transmit complete interrupt entry.
*/
-#if defined(SIG_UART1_TRANS) || defined(iv_USART1_TX)
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_UART1_TRANS:iv_USART1_TX
+#pragma interrupt_handler USART1_TX_vect:iv_USART1_TX
#endif
-NUTSIGNAL(SIG_UART1_TRANS, sig_UART1_TRANS)
-#elif defined(SIG_USART1_TRANS)
-NUTSIGNAL(SIG_USART1_TRANS, sig_UART1_TRANS)
-#endif
+NUTSIGNAL(USART1_TX_vect, sig_UART1_TRANS)
#endif
/*@}*/
Index: dev/ih_usart1_udre.c
===================================================================
--- dev/ih_usart1_udre.c (Revision 4548)
+++ dev/ih_usart1_udre.c (Arbeitskopie)
@@ -88,7 +88,18 @@
*/
/*@{*/
-#if defined(SIG_UART1_DATA) || defined(iv_USART1_UDRE) || defined(SIG_USART1_DATA)
+/* avr-libc names the vector as in the datasheets. As Atmel naming is
+ * inconsistant, so is the avr-libc naming.
+ * Equalize!
+ */
+/* avr-libc names the vector as in the datasheets. As Atmel naming is
+ * inconsistant, so is the avr-libc naming.
+ * Equalize!
+ */
+#if !defined(USART1_UDRE_vect) && defined(UART1_UDRE_vect)
+#define USART1_UDRE_vect UART1_UDRE_vect
+#endif
+#if defined(USART1_UDRE_vect) || defined(iv_USART1_UDRE)
static int AvrUart1TxDataIrqCtl(int cmd, void *param);
@@ -166,17 +177,13 @@
return rc;
}
-/*! \fn SIG_UART1_DATA(void)
+/*! \fn UART1_UDRE_vect(void)
* Uart1 data register empty interrupt entry.
*/
-#if defined(SIG_UART1_DATA) || defined(iv_USART1_UDRE)
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_UART1_DATA:iv_USART1_UDRE
+#pragma interrupt_handler USART1_UDRE_vect:iv_USART1_UDRE
#endif
-NUTSIGNAL(SIG_UART1_DATA, sig_UART1_DATA)
-#elif defined(SIG_USART1_DATA)
-NUTSIGNAL(SIG_USART1_DATA, sig_UART1_DATA)
-#endif
+NUTSIGNAL(USART1_UDRE_vect, sig_UART1_DATA)
#endif
/*@}*/
Index: dev/irsony.c
===================================================================
--- dev/irsony.c (Revision 4548)
+++ dev/irsony.c (Arbeitskopie)
@@ -55,8 +55,8 @@
#include <sys/event.h>
#ifdef __IMAGECRAFT__
-#pragma interrupt_handler SIG_INTERRUPT4:iv_INT4
-#pragma interrupt_handler SIG_OVERFLOW2:iv_TIMER2_OVF
+#pragma interrupt_handler INT4_vect:iv_INT4
+#pragma interrupt_handler TIMER2_OVF_vect:iv_TIMER2_OVF
#endif
/*!
@@ -90,10 +90,10 @@
*/
static uint8_t irbitnum;
-/*! \fn SIG_OVERFLOW2(void)
+/*! \fn TIMER2_OVF_vect(void)
* \brief Timer 2 overflow handler.
*/
-SIGNAL(SIG_OVERFLOW2)
+SIGNAL(TIMER2_OVF_vect)
{
/* Set the timer value. */
outb(TCNT2, IRTIMER_START);
@@ -108,10 +108,10 @@
}
}
-/*! \fn SIG_INTERRUPT4(void)
+/*! \fn INT4_vect(void)
* \brief Infrared decoder signal edge handler.
*/
-SIGNAL(SIG_INTERRUPT4)
+SIGNAL(INT4_vect)
{
static uint16_t minset; /* Min. length of bit value 1, calculated from start bit. */
static uint16_t ccode; /* Current code. */
Index: dev/usart0avr.c
===================================================================
--- dev/usart0avr.c (Revision 4548)
+++ dev/usart0avr.c (Arbeitskopie)
@@ -428,15 +428,30 @@
#define sig_UART_DATA sig_UART0_DATA
#define sig_UART_TRANS sig_UART0_TRANS
-#ifndef SIG_UART_RECV
-#define SIG_UART_RECV SIG_UART0_RECV
+/* avr-libc names the vector as in the datasheets. As Atmel naming is
+ * inconsistant, so is the avr-libc naming.
+ * Equalize!
+ */
+#if !defined(USART0_RX_vect) && defined( UART0_RX_vect)
+#define USART0_RX_vect UART0_RX_vect
+#elif !defined(USART0_RX_vect) && defined(UART_RX_vect)
+#define USART0_RX_vect UART_RX_vect
#endif
-#ifndef SIG_UART_DATA
-#define SIG_UART_DATA SIG_UART0_DATA
+#define SIG_AVRUART_RECV USART0_RX_vect
+
+#if !defined(USART0_UDRE_vect) && defined(UART0_UDRE_vect)
+#define USART0_UDRE_vect UART0_UDRE_vect
+#elif !defined(USART0_UDRE_vect) && defined(UART_UDRE_vect)
+#define USART0_UDRE_vect UART_UDRE_vect
#endif
-#ifndef SIG_UART_TRANS
-#define SIG_UART_TRANS SIG_UART0_TRANS
+#define SIG_AVRUART_DATA USART0_UDRE_vect
+
+#if !defined(USART0_TX_vect) && defined( UART0_TX_vect)
+#define USART0_TX_vect UART0_TX_vect
+#elif !defined(USART0_TX_vect) && defined(UART_TX_vect)
+#define USART0_TX_vect UART_TX_vect
#endif
+#define SIG_AVRUART_TRANS USART0_TX_vect
#define dcb_usart dcb_usart0
Index: dev/usart1avr.c
===================================================================
--- dev/usart1avr.c (Revision 4552)
+++ dev/usart1avr.c (Arbeitskopie)
@@ -418,9 +418,22 @@
#define sig_UART_DATA sig_UART1_DATA
#define sig_UART_TRANS sig_UART1_TRANS
-#define SIG_AVRUART_RECV SIG_UART1_RECV
-#define SIG_AVRUART_DATA SIG_UART1_DATA
-#define SIG_AVRUART_TRANS SIG_UART1_TRANS
+/* avr-libc names the vector as in the datasheets. As Atmel naming is
+ * inconsistant, so is the avr-libc naming.
+ * Equalize!
+ */
+#if !defined(USART1_RX_vect) && defined(UART1_RX_vect)
+#define USART1_RX_vect UART1_RX_vect
+#endif
+#define SIG_AVRUART_RECV USART1_RX_vect
+#if !defined(USART1_UDRE_vect) && defined(UART1_UDRE_vect)
+#define USART1_UDRE_vect UART1_UDRE_vect
+#endif
+#define SIG_AVRUART_DATA USART1_UDRE_vect
+#if !defined(USART1_TX_vect) && defined(UART1_TX_vect)
+#define USART1_TX_vect UART1_TX_vect
+#endif
+#define SIG_AVRUART_TRANS USART1_TX_vect
#define dcb_usart dcb_usart1
More information about the En-Nut-Discussion
mailing list