summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6dadb87)
Fix multiservo_archs.h that defines output compare interrupt vector
names for atmega128 and atmega32.
Signed-off-by: Gregor Riepl <onitake@gmail.com>
#if defined (__AVR_ATmega128__)
#if MULTISERVO_TIMER == 0
#if defined (__AVR_ATmega128__)
#if MULTISERVO_TIMER == 0
-#define MULTISERVO_SIG_OUTPUT_COMPARE SIG_OUTPUT_COMPARE0
+#ifndef TIMER0_COMP_vect
+#if defined(SIG_OUTPUT_COMPARE0)
+#define TIMER0_COMP_vect SIG_OUTPUT_COMPARE0
+#endif
+#endif
+#define MULTISERVO_SIG_OUTPUT_COMPARE TIMER0_COMP_vect
#define MULTISERVO_TIMSK TIMSK
#define MULTISERVO_OCIE OCIE0
#define MULTISERVO_TCCRnA TCCR0
#define MULTISERVO_TIMSK TIMSK
#define MULTISERVO_OCIE OCIE0
#define MULTISERVO_TCCRnA TCCR0
#define MULTISERVO_OCR OCR0
#elif MULTISERVO_TIMER == 1
#define MULTISERVO_OCR OCR0
#elif MULTISERVO_TIMER == 1
-#define MULTISERVO_SIG_OUTPUT_COMPARE SIG_OUTPUT_COMPARE1A
+#ifndef TIMER1_COMPA_vect
+#if defined(SIG_OUTPUT_COMPARE1A)
+#define TIMER1_COMPA_vect SIG_OUTPUT_COMPARE1A
+#endif
+#endif
+#define MULTISERVO_SIG_OUTPUT_COMPARE TIMER1_COMPA_vect
#define MULTISERVO_TIMSK TIMSK
#define MULTISERVO_OCIE OCIE1A
#define MULTISERVO_TCCRnA TCCR1A
#define MULTISERVO_TIMSK TIMSK
#define MULTISERVO_OCIE OCIE1A
#define MULTISERVO_TCCRnA TCCR1A
#define MULTISERVO_OCR OCR1A
#elif MULTISERVO_TIMER == 2
#define MULTISERVO_OCR OCR1A
#elif MULTISERVO_TIMER == 2
-#define MULTISERVO_SIG_OUTPUT_COMPARE SIG_OUTPUT_COMPARE2
+#ifndef TIMER2_COMP_vect
+#if defined(SIG_OUTPUT_COMPARE2)
+#define TIMER2_COMP_vect SIG_OUTPUT_COMPARE2
+#endif
+#endif
+#define MULTISERVO_SIG_OUTPUT_COMPARE TIMER2_COMP_vect
#define MULTISERVO_TIMSK TIMSK
#define MULTISERVO_OCIE OCIE2
#define MULTISERVO_TCCRnA TCCR2
#define MULTISERVO_TIMSK TIMSK
#define MULTISERVO_OCIE OCIE2
#define MULTISERVO_TCCRnA TCCR2
#define MULTISERVO_OCR OCR2
#elif MULTISERVO_TIMER == 3
#define MULTISERVO_OCR OCR2
#elif MULTISERVO_TIMER == 3
-#define MULTISERVO_SIG_OUTPUT_COMPARE SIG_OUTPUT_COMPARE3A
+#ifndef TIMER3_COMPA_vect
+#if defined(SIG_OUTPUT_COMPARE3A)
+#define TIMER3_COMPA_vect SIG_OUTPUT_COMPARE3A
+#endif
+#endif
+#define MULTISERVO_SIG_OUTPUT_COMPARE TIMER3_COMPA_vect
#define MULTISERVO_TIMSK ETIMSK
#define MULTISERVO_OCIE OCIE3A
#define MULTISERVO_TCCRnA TCCR3A
#define MULTISERVO_TIMSK ETIMSK
#define MULTISERVO_OCIE OCIE3A
#define MULTISERVO_TCCRnA TCCR3A
#elif defined (__AVR_ATmega32__)
#if MULTISERVO_TIMER == 0
#elif defined (__AVR_ATmega32__)
#if MULTISERVO_TIMER == 0
-#define MULTISERVO_SIG_OUTPUT_COMPARE SIG_OUTPUT_COMPARE0
+#ifndef TIMER0_COMP_vect
+#if defined(SIG_OUTPUT_COMPARE0)
+#define TIMER0_COMP_vect SIG_OUTPUT_COMPARE0
+#endif
+#endif
+#define MULTISERVO_SIG_OUTPUT_COMPARE TIMER0_COMP_vect
#define MULTISERVO_TIMSK TIMSK
#define MULTISERVO_OCIE OCIE0
#define MULTISERVO_TCCRnA TCCR0
#define MULTISERVO_TIMSK TIMSK
#define MULTISERVO_OCIE OCIE0
#define MULTISERVO_TCCRnA TCCR0
#define MULTISERVO_OCR OCR0
#elif MULTISERVO_TIMER == 1
#define MULTISERVO_OCR OCR0
#elif MULTISERVO_TIMER == 1
-#define MULTISERVO_SIG_OUTPUT_COMPARE SIG_OUTPUT_COMPARE1A
+#ifndef TIMER1_COMPA_vect
+#if defined(SIG_OUTPUT_COMPARE1A)
+#define TIMER1_COMPA_vect SIG_OUTPUT_COMPARE1A
+#endif
+#endif
+#define MULTISERVO_SIG_OUTPUT_COMPARE TIMER1_COMPA_vect
#define MULTISERVO_TIMSK TIMSK
#define MULTISERVO_OCIE OCIE1A
#define MULTISERVO_TCCRnA TCCR1A
#define MULTISERVO_TIMSK TIMSK
#define MULTISERVO_OCIE OCIE1A
#define MULTISERVO_TCCRnA TCCR1A
#define MULTISERVO_OCR OCR1A
#elif MULTISERVO_TIMER == 2
#define MULTISERVO_OCR OCR1A
#elif MULTISERVO_TIMER == 2
-#define MULTISERVO_SIG_OUTPUT_COMPARE SIG_OUTPUT_COMPARE2
+#ifndef TIMER2_COMP_vect
+#if defined(SIG_OUTPUT_COMPARE2)
+#define TIMER2_COMP_vect SIG_OUTPUT_COMPARE2
+#endif
+#endif
+#define MULTISERVO_SIG_OUTPUT_COMPARE TIMER2_COMP_vect
#define MULTISERVO_TIMSK TIMSK
#define MULTISERVO_OCIE OCIE2
#define MULTISERVO_TCCRnA TCCR2
#define MULTISERVO_TIMSK TIMSK
#define MULTISERVO_OCIE OCIE2
#define MULTISERVO_TCCRnA TCCR2
#elif defined (__AVR_ATtiny2313__)
#if MULTISERVO_TIMER == 0
#elif defined (__AVR_ATtiny2313__)
#if MULTISERVO_TIMER == 0
-#define MULTISERVO_SIG_OUTPUT_COMPARE SIG_OUTPUT_COMPARE0
+#ifndef TIMER0_COMP_vect
+#if defined(SIG_OUTPUT_COMPARE0)
+#define TIMER0_COMP_vect SIG_OUTPUT_COMPARE0
+#endif
+#endif
+#define MULTISERVO_SIG_OUTPUT_COMPARE TIMER0_COMP_vect
#define MULTISERVO_TIMSK TIMSK
#define MULTISERVO_OCIE OCIE0
#define MULTISERVO_TCCRnA TCCR0A
#define MULTISERVO_TIMSK TIMSK
#define MULTISERVO_OCIE OCIE0
#define MULTISERVO_TCCRnA TCCR0A
#define MULTISERVO_OCR OCR0
#elif MULTISERVO_TIMER == 1
#define MULTISERVO_OCR OCR0
#elif MULTISERVO_TIMER == 1
-#define MULTISERVO_SIG_OUTPUT_COMPARE SIG_OUTPUT_COMPARE1A
+#ifndef TIMER1_COMPA_vect
+#if defined(SIG_OUTPUT_COMPARE1A)
+#define TIMER1_COMPA_vect SIG_OUTPUT_COMPARE1A
+#endif
+#endif
+#define MULTISERVO_SIG_OUTPUT_COMPARE TIMER1_COMPA_vect
#define MULTISERVO_TIMSK TIMSK
#define MULTISERVO_OCIE OCIE1A
#define MULTISERVO_TCCRnA TCCR1A
#define MULTISERVO_TIMSK TIMSK
#define MULTISERVO_OCIE OCIE1A
#define MULTISERVO_TCCRnA TCCR1A