Skip to content

Commit

Permalink
Removed deprecated interrupt handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Mar 29, 2013
1 parent 0e7a434 commit f88c984
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 44 deletions.
4 changes: 3 additions & 1 deletion build/shared/revisions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ ARDUINO 1.0.5

[core]

* malloc bug: backported avr-libc 1.8.0 implementation
* [avr] malloc bug: backported avr-libc 1.8.0 implementation
* [avr] removed deprecated interrupt handlers causing compiler issues
with newer avr-gcc.

[libraries]

Expand Down
26 changes: 6 additions & 20 deletions hardware/arduino/cores/arduino/HardwareSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,24 +104,16 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
#if !defined(USART0_RX_vect) && defined(USART1_RX_vect)
// do nothing - on the 32u4 the first USART is USART1
#else
#if !defined(USART_RX_vect) && !defined(SIG_USART0_RECV) && \
!defined(SIG_UART0_RECV) && !defined(USART0_RX_vect) && \
!defined(SIG_UART_RECV)
#if !defined(USART_RX_vect) && !defined(USART0_RX_vect)
#error "Don't know what the Data Received vector is called for the first UART"
#else
void serialEvent() __attribute__((weak));
void serialEvent() {}
#define serialEvent_implemented
#if defined(USART_RX_vect)
SIGNAL(USART_RX_vect)
#elif defined(SIG_USART0_RECV)
SIGNAL(SIG_USART0_RECV)
#elif defined(SIG_UART0_RECV)
SIGNAL(SIG_UART0_RECV)
ISR(USART_RX_vect)
#elif defined(USART0_RX_vect)
SIGNAL(USART0_RX_vect)
#elif defined(SIG_UART_RECV)
SIGNAL(SIG_UART_RECV)
ISR(USART0_RX_vect)
#endif
{
#if defined(UDR0)
Expand Down Expand Up @@ -149,7 +141,7 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
void serialEvent1() __attribute__((weak));
void serialEvent1() {}
#define serialEvent1_implemented
SIGNAL(USART1_RX_vect)
ISR(USART1_RX_vect)
{
if (bit_is_clear(UCSR1A, UPE1)) {
unsigned char c = UDR1;
Expand All @@ -158,15 +150,13 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
unsigned char c = UDR1;
};
}
#elif defined(SIG_USART1_RECV)
#error SIG_USART1_RECV
#endif

#if defined(USART2_RX_vect) && defined(UDR2)
void serialEvent2() __attribute__((weak));
void serialEvent2() {}
#define serialEvent2_implemented
SIGNAL(USART2_RX_vect)
ISR(USART2_RX_vect)
{
if (bit_is_clear(UCSR2A, UPE2)) {
unsigned char c = UDR2;
Expand All @@ -175,15 +165,13 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
unsigned char c = UDR2;
};
}
#elif defined(SIG_USART2_RECV)
#error SIG_USART2_RECV
#endif

#if defined(USART3_RX_vect) && defined(UDR3)
void serialEvent3() __attribute__((weak));
void serialEvent3() {}
#define serialEvent3_implemented
SIGNAL(USART3_RX_vect)
ISR(USART3_RX_vect)
{
if (bit_is_clear(UCSR3A, UPE3)) {
unsigned char c = UDR3;
Expand All @@ -192,8 +180,6 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
unsigned char c = UDR3;
};
}
#elif defined(SIG_USART3_RECV)
#error SIG_USART3_RECV
#endif

void serialEventRun(void)
Expand Down
32 changes: 16 additions & 16 deletions hardware/arduino/cores/arduino/WInterrupts.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,82 +230,82 @@ void attachInterruptTwi(void (*userFunc)(void) ) {
*/

#if defined(__AVR_ATmega32U4__)
SIGNAL(INT0_vect) {
ISR(INT0_vect) {
if(intFunc[EXTERNAL_INT_0])
intFunc[EXTERNAL_INT_0]();
}

SIGNAL(INT1_vect) {
ISR(INT1_vect) {
if(intFunc[EXTERNAL_INT_1])
intFunc[EXTERNAL_INT_1]();
}

SIGNAL(INT2_vect) {
ISR(INT2_vect) {
if(intFunc[EXTERNAL_INT_2])
intFunc[EXTERNAL_INT_2]();
}

SIGNAL(INT3_vect) {
ISR(INT3_vect) {
if(intFunc[EXTERNAL_INT_3])
intFunc[EXTERNAL_INT_3]();
}

#elif defined(EICRA) && defined(EICRB)

SIGNAL(INT0_vect) {
ISR(INT0_vect) {
if(intFunc[EXTERNAL_INT_2])
intFunc[EXTERNAL_INT_2]();
}

SIGNAL(INT1_vect) {
ISR(INT1_vect) {
if(intFunc[EXTERNAL_INT_3])
intFunc[EXTERNAL_INT_3]();
}

SIGNAL(INT2_vect) {
ISR(INT2_vect) {
if(intFunc[EXTERNAL_INT_4])
intFunc[EXTERNAL_INT_4]();
}

SIGNAL(INT3_vect) {
ISR(INT3_vect) {
if(intFunc[EXTERNAL_INT_5])
intFunc[EXTERNAL_INT_5]();
}

SIGNAL(INT4_vect) {
ISR(INT4_vect) {
if(intFunc[EXTERNAL_INT_0])
intFunc[EXTERNAL_INT_0]();
}

SIGNAL(INT5_vect) {
ISR(INT5_vect) {
if(intFunc[EXTERNAL_INT_1])
intFunc[EXTERNAL_INT_1]();
}

SIGNAL(INT6_vect) {
ISR(INT6_vect) {
if(intFunc[EXTERNAL_INT_6])
intFunc[EXTERNAL_INT_6]();
}

SIGNAL(INT7_vect) {
ISR(INT7_vect) {
if(intFunc[EXTERNAL_INT_7])
intFunc[EXTERNAL_INT_7]();
}

#else

SIGNAL(INT0_vect) {
ISR(INT0_vect) {
if(intFunc[EXTERNAL_INT_0])
intFunc[EXTERNAL_INT_0]();
}

SIGNAL(INT1_vect) {
ISR(INT1_vect) {
if(intFunc[EXTERNAL_INT_1])
intFunc[EXTERNAL_INT_1]();
}

#if defined(EICRA) && defined(ISC20)
SIGNAL(INT2_vect) {
ISR(INT2_vect) {
if(intFunc[EXTERNAL_INT_2])
intFunc[EXTERNAL_INT_2]();
}
Expand All @@ -314,7 +314,7 @@ SIGNAL(INT2_vect) {
#endif

/*
SIGNAL(SIG_2WIRE_SERIAL) {
ISR(TWI_vect) {
if(twiIntFunc)
twiIntFunc();
}
Expand Down
4 changes: 2 additions & 2 deletions hardware/arduino/cores/arduino/wiring.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ volatile unsigned long timer0_millis = 0;
static unsigned char timer0_fract = 0;

#if defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
SIGNAL(TIM0_OVF_vect)
ISR(TIM0_OVF_vect)
#else
SIGNAL(TIMER0_OVF_vect)
ISR(TIMER0_OVF_vect)
#endif
{
// copy these to local variables so they can be stored in registers
Expand Down
8 changes: 4 additions & 4 deletions libraries/Servo/Servo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,28 +100,28 @@ static inline void handle_interrupts(timer16_Sequence_t timer, volatile uint16_t
#ifndef WIRING // Wiring pre-defines signal handlers so don't define any if compiling for the Wiring platform
// Interrupt handlers for Arduino
#if defined(_useTimer1)
SIGNAL (TIMER1_COMPA_vect)
ISR(TIMER1_COMPA_vect)
{
handle_interrupts(_timer1, &TCNT1, &OCR1A);
}
#endif

#if defined(_useTimer3)
SIGNAL (TIMER3_COMPA_vect)
ISR(TIMER3_COMPA_vect)
{
handle_interrupts(_timer3, &TCNT3, &OCR3A);
}
#endif

#if defined(_useTimer4)
SIGNAL (TIMER4_COMPA_vect)
ISR(TIMER4_COMPA_vect)
{
handle_interrupts(_timer4, &TCNT4, &OCR4A);
}
#endif

#if defined(_useTimer5)
SIGNAL (TIMER5_COMPA_vect)
ISR(TIMER5_COMPA_vect)
{
handle_interrupts(_timer5, &TCNT5, &OCR5A);
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/Wire/utility/twi.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ void twi_releaseBus(void)
twi_state = TWI_READY;
}

SIGNAL(TWI_vect)
ISR(TWI_vect)
{
switch(TW_STATUS){
// All Master
Expand Down

0 comments on commit f88c984

Please sign in to comment.