From ab41589c2b92607bec6b830dbebbbc74c4a46b0b Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Fri, 29 Mar 2013 14:41:36 +0100 Subject: Removed deprecated interrupt handlers Fixes #831 #881 #955 #1123 #1140 --- cores/arduino/HardwareSerial.cpp | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'cores/arduino/HardwareSerial.cpp') diff --git a/cores/arduino/HardwareSerial.cpp b/cores/arduino/HardwareSerial.cpp index 794a7be..6e623d6 100644 --- a/cores/arduino/HardwareSerial.cpp +++ b/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) -- cgit v1.2.3-18-g5258 From f50c307be280dc6ece9e70c43b301c1db36291a0 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Fri, 29 Mar 2013 15:17:54 +0100 Subject: Fix deprecated ISR names for ATmega8. See #881 --- cores/arduino/HardwareSerial.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cores/arduino/HardwareSerial.cpp') diff --git a/cores/arduino/HardwareSerial.cpp b/cores/arduino/HardwareSerial.cpp index 6e623d6..eb2365f 100644 --- a/cores/arduino/HardwareSerial.cpp +++ b/cores/arduino/HardwareSerial.cpp @@ -104,7 +104,8 @@ 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(USART0_RX_vect) +#if !defined(USART_RX_vect) && !defined(USART0_RX_vect) && \ + !defined(USART_RXC_vect) #error "Don't know what the Data Received vector is called for the first UART" #else void serialEvent() __attribute__((weak)); @@ -114,6 +115,8 @@ inline void store_char(unsigned char c, ring_buffer *buffer) ISR(USART_RX_vect) #elif defined(USART0_RX_vect) ISR(USART0_RX_vect) +#elif defined(USART_RXC_vect) + ISR(USART_RXC_vect) // ATmega8 #endif { #if defined(UDR0) -- cgit v1.2.3-18-g5258