diff --git a/build/shared/revisions.txt b/build/shared/revisions.txt index b01fc9313..b03c0fc21 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -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] diff --git a/hardware/arduino/cores/arduino/HardwareSerial.cpp b/hardware/arduino/cores/arduino/HardwareSerial.cpp index 794a7be89..6e623d6a5 100644 --- a/hardware/arduino/cores/arduino/HardwareSerial.cpp +++ b/hardware/arduino/cores/arduino/HardwareSerial.cpp @@ -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) @@ -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; @@ -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; @@ -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; @@ -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) diff --git a/hardware/arduino/cores/arduino/WInterrupts.c b/hardware/arduino/cores/arduino/WInterrupts.c index 62efc9cad..de49cd16e 100644 --- a/hardware/arduino/cores/arduino/WInterrupts.c +++ b/hardware/arduino/cores/arduino/WInterrupts.c @@ -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](); } @@ -314,7 +314,7 @@ SIGNAL(INT2_vect) { #endif /* -SIGNAL(SIG_2WIRE_SERIAL) { +ISR(TWI_vect) { if(twiIntFunc) twiIntFunc(); } diff --git a/hardware/arduino/cores/arduino/wiring.c b/hardware/arduino/cores/arduino/wiring.c index ac8bb6f9b..a3c4390e3 100644 --- a/hardware/arduino/cores/arduino/wiring.c +++ b/hardware/arduino/cores/arduino/wiring.c @@ -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 diff --git a/libraries/Servo/Servo.cpp b/libraries/Servo/Servo.cpp index a71643323..a17ed34e1 100755 --- a/libraries/Servo/Servo.cpp +++ b/libraries/Servo/Servo.cpp @@ -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); } diff --git a/libraries/Wire/utility/twi.c b/libraries/Wire/utility/twi.c index 6b2db3cdc..201d7d1bb 100644 --- a/libraries/Wire/utility/twi.c +++ b/libraries/Wire/utility/twi.c @@ -360,7 +360,7 @@ void twi_releaseBus(void) twi_state = TWI_READY; } -SIGNAL(TWI_vect) +ISR(TWI_vect) { switch(TW_STATUS){ // All Master