# HG changeset patch # User asl # Date 1100163854 0 # Node ID 1865520e607a61579b6fdde8af1d0df91ea2509f # Parent de3268a7fa424c837b0d5253a0871c88a9d6a331 * src/hal_diag.c: Added support for the third serial port diff --git a/packages/hal/arm/at91/var/current/ChangeLog b/packages/hal/arm/at91/var/current/ChangeLog --- 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 + + * src/hal_diag.c: Added support for the third serial port + 2004-10-06 Andrea Michelotti * include/var_io.h: protected PDC/SPI DMA registers from redefinition. diff --git a/packages/hal/arm/at91/var/current/src/hal_diag.c b/packages/hal/arm/at91/var/current/src/hal_diag.c --- 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);