[En-Nut-Discussion] Troubles with uart1

Alexander Baranov Baranov at intech21.com
Tue Feb 4 16:55:53 CET 2003


Hi. Try
 NutRegisterDevice(&devUart1, 1, 0);
  uart1 = NutDeviceOpen("uart1"); 
Maybe it will help
Regards, Alex
----- Original Message ----- 
From: <maurilio.bortolussi at ade.it>
To: <en-nut-discussion at egnite.de>
Sent: Tuesday, February 04, 2003 2:22 AM
Subject: [En-Nut-Discussion] Troubles with uart1


> Hello,
> 
> i am a newbie of Nut/OS i  am working with Nut/OS 2.6.0 and GCC 3.3;
> 
> i want to use the uart1 with httpd example but i have some troubles.
> I introduced the code below and the result is that uart0 works but the
> uart1  doesn't work.
> 
> Why ?
> 
> Maurilio
> 
> 
> 
> 
> #define _UART1
> 
> #ifdef _UART1
>   NUTDEVICE *uart0;
>   NUTDEVICE *uart1;
> #endif
> 
> 
> THREAD(NutMain, arg)
> {
>     u_long baud = 115200;
>     u_char i;
> 
>     /*
>      * Initialize the uart device.
>      */
> #ifdef _UART1
>     NutRegisterDevice(&devUart0, 0, 0);
>     uart0 = NutDeviceOpen("uart0");
>     NutDeviceIOCtl(uart0, UART_SETSPEED, &baud);
> 
>     NutRegisterDevice(&devUart1, 0, 0);
>     uart1 = NutDeviceOpen("uart1");
>     NutDeviceIOCtl(uart1, UART_SETSPEED, &baud);
>   #else
>     NutDeviceIOCtl(0, UART_SETSPEED, &baud);
>     outp(BV(RXEN) | BV(TXEN), UCR);
>   #endif
> 
> 
> #ifdef _UART1
>     NutPrintString_P(uart0, PSTR("\r\n uart0 HTTP Daemon..."));
>     NutPrintFlush(uart0);
>     NutPrintString_P(uart1, PSTR("\r\n uart1 HTTP Daemon..."));
>     NutPrintFlush(uart1);
>   #else
>     NutPrintString_P(0, PSTR("\r\nHTTP Daemon..."));
>   #endif
> 
> ........
> 
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo/en-nut-discussion



More information about the En-Nut-Discussion mailing list