changeset 1826:1865520e607a

* src/hal_diag.c: Added support for the third serial port
author asl
date Thu, 11 Nov 2004 09:04:14 +0000
parents de3268a7fa42
children f21d41fc8556
files packages/hal/arm/at91/var/current/ChangeLog packages/hal/arm/at91/var/current/src/hal_diag.c
diffstat 2 files changed, 22 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/packages/hal/arm/at91/var/current/ChangeLog
+++ b/packages/hal/arm/at91/var/current/ChangeLog
@@ -1,3 +1,7 @@
+2004-11-11  Sebastian Block <SebastianBlock@gmx.net>
+
+	* src/hal_diag.c: Added support for the third serial port
+	
 2004-10-06  Andrea Michelotti <amichelotti@atmel.com>
 
 	* include/var_io.h: protected PDC/SPI DMA registers from redefinition.
--- a/packages/hal/arm/at91/var/current/src/hal_diag.c
+++ b/packages/hal/arm/at91/var/current/src/hal_diag.c
@@ -269,9 +269,10 @@ cyg_hal_plf_serial_isr(void *__ch_data, 
     return res;
 }
 
-static channel_data_t at91_ser_channels[2] = {
+static channel_data_t at91_ser_channels[3] = {
     { (cyg_uint8*)AT91_USART0, 1000, CYGNUM_HAL_INTERRUPT_USART0, CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD},
-    { (cyg_uint8*)AT91_USART1, 1000, CYGNUM_HAL_INTERRUPT_USART1, CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD}
+    { (cyg_uint8*)AT91_USART1, 1000, CYGNUM_HAL_INTERRUPT_USART1, CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD},
+    { (cyg_uint8*)AT91_USART2, 1000, CYGNUM_HAL_INTERRUPT_USART2, CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD}
 };
 
 static void
@@ -287,7 +288,9 @@ cyg_hal_plf_serial_init(void)
 #if CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS > 1
     cyg_hal_plf_serial_init_channel(&at91_ser_channels[1]);
 #endif
-
+#if CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS > 2
+    cyg_hal_plf_serial_init_channel(&at91_ser_channels[2]);
+#endif
     // Setup procs in the vector table
 
     // Set channel 0
@@ -315,6 +318,18 @@ cyg_hal_plf_serial_init(void)
     CYGACC_COMM_IF_DBG_ISR_SET(*comm, cyg_hal_plf_serial_isr);
     CYGACC_COMM_IF_GETC_TIMEOUT_SET(*comm, cyg_hal_plf_serial_getc_timeout);
 #endif
+#if CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS > 2    
+    CYGACC_CALL_IF_SET_CONSOLE_COMM(2);
+    comm = CYGACC_CALL_IF_CONSOLE_PROCS();
+    CYGACC_COMM_IF_CH_DATA_SET(*comm, &at91_ser_channels[2]);
+    CYGACC_COMM_IF_WRITE_SET(*comm, cyg_hal_plf_serial_write);
+    CYGACC_COMM_IF_READ_SET(*comm, cyg_hal_plf_serial_read);
+    CYGACC_COMM_IF_PUTC_SET(*comm, cyg_hal_plf_serial_putc);
+    CYGACC_COMM_IF_GETC_SET(*comm, cyg_hal_plf_serial_getc);
+    CYGACC_COMM_IF_CONTROL_SET(*comm, cyg_hal_plf_serial_control);
+    CYGACC_COMM_IF_DBG_ISR_SET(*comm, cyg_hal_plf_serial_isr);
+    CYGACC_COMM_IF_GETC_TIMEOUT_SET(*comm, cyg_hal_plf_serial_getc_timeout);
+#endif
 
     // Restore original console
     CYGACC_CALL_IF_SET_CONSOLE_COMM(cur);