USBCDC print string

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USBCDC print string

1,044 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by james on Wed Apr 18 03:08:40 MST 2012
Hi guy,

I modified the example in USBCDC to printstring instead of a single char by looping.

void VCOM_putstring(char *pcString)
{
    VCOM_putchar(13);                    //return carriage
    long i = 0;
    // loop through until reach string's zero terminator
    for (i=0;i<strlen(pcString);i++)
    {
        VCOM_putchar(pcString); // print each character
    }
}


However, this only prints up to 120chars into the teraterm. how can i modify it to print a lot more??
0 Kudos
Reply
2 Replies

1,002 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by james on Wed Apr 18 19:20:18 MST 2012
Remove the strlen() works like a charm thanks
0 Kudos
Reply

1,002 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gbm on Wed Apr 18 03:25:33 MST 2012
You need to modify VCOM_putchar so that it will wait for a free place in FIFO instead of exiting with EOF. Be warned that this is not the only problem with CDC sample.

Also, remove that strlen from your code. Check for NUL character instead before printing each char.:rolleyes:
0 Kudos
Reply