diff options
Diffstat (limited to 'cores/arduino/HardwareSerial.cpp')
-rw-r--r-- | cores/arduino/HardwareSerial.cpp | 26 |
1 files changed, 6 insertions, 20 deletions
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) |