Serial Flush() ?

29 Aug 2010

Is there a method to flush the serial port and clear all of the data from the buffer?

31 Aug 2010

No, but good idea. I'll look to add that.

01 Sep 2010

The last one should be:

LPC_UART0->FCR |= 0x06; 

07 Mar 2012

A simple (and crude) method that works for me:

void flushSerialBuffer(void) { char char1 = 0; while (device.readable()) { char1 = device.getc(); } return; }

03 May 2012

how can I know what pins are UART0 register? thx

25 Jun 2012

David Russ wrote:

A simple (and crude) method that works for me:

void flushSerialBuffer(void) { char char1 = 0; while (device.readable()) { char1 = device.getc(); } return; }

Thanks for this.

27 Oct 2012

David Russ wrote:

A simple (and crude) method that works for me:

void flushSerialBuffer(void) { char char1 = 0; while (device.readable()) { char1 = device.getc(); } return; }

Thank you, this is absolutely necessary everywhere in serial communication!

09 Nov 2019

does it exists now a function for flushing buffer?