summaryrefslogtreecommitdiff
path: root/n/avr/rs232/rs232.c
diff options
context:
space:
mode:
Diffstat (limited to 'n/avr/rs232/rs232.c')
-rw-r--r--n/avr/rs232/rs232.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/n/avr/rs232/rs232.c b/n/avr/rs232/rs232.c
index bf1c83b..5510e45 100644
--- a/n/avr/rs232/rs232.c
+++ b/n/avr/rs232/rs232.c
@@ -37,14 +37,25 @@
/* UART number. */
#if !defined (UBRRH)
# if defined (UBRR0H)
-# define UBRRH UBRR0H
-# define UBRRL UBRR0L
-# define UCSRA UCSR0A
-# define UCSRB UCSR0B
-# define UCSRC UCSR0C
-# define UDR UDR0
-# define SIG_UART_RECV SIG_UART0_RECV
-# define SIG_UART_DATA SIG_UART0_DATA
+# if AC_RS232_PORT == 1
+# define UBRRH UBRR1H
+# define UBRRL UBRR1L
+# define UCSRA UCSR1A
+# define UCSRB UCSR1B
+# define UCSRC UCSR1C
+# define UDR UDR1
+# define SIG_UART_RECV SIG_UART1_RECV
+# define SIG_UART_DATA SIG_UART1_DATA
+# else
+# define UBRRH UBRR0H
+# define UBRRL UBRR0L
+# define UCSRA UCSR0A
+# define UCSRB UCSR0B
+# define UCSRC UCSR0C
+# define UDR UDR0
+# define SIG_UART_RECV SIG_UART0_RECV
+# define SIG_UART_DATA SIG_UART0_DATA
+# endif
# define PE UPE
# else
# error "rs232: canot find UBRR."