This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How do I flush the UART receive buffer in Tiva C series TM4C123GXL using API(s) like uart.c and uartstdio.c

Other Parts Discussed in Thread: EK-TM4C123GXL

In the following code snippet; I am checking if characters are available and printing the same. But I want to store these characters as string until someone presses 'Enter' key. For ex: if the input to speed is 50. I should be able to receive 50 in string, print it on console and then process it into decimal value for further evaluation.

  1. while( 1 ) { 
  2.         if( UARTCharsAvail(UART0_BASE) )
  3.             UARTCharPut( UART0_BASE, UARTCharGet(UART0_BASE) );

    But when I try to echo the same character on console, my UART receive buffer gets over written with the printed value. It takes both input from keyboard and the printed value.
    Any suggestions?