[En-Nut-Discussion] Troubles with uart1

maurilio.bortolussi at ade.it maurilio.bortolussi at ade.it
Tue Feb 4 08:22:07 CET 2003


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

........




More information about the En-Nut-Discussion mailing list