From 435f6790da577b0c028bce196b5e6601c4a8d046 Mon Sep 17 00:00:00 2001 From: Sandeep Mistry Date: Tue, 17 Nov 2015 13:20:11 -0500 Subject: [PATCH] Check TXEMPTY flag instead of TXRDY flag on Serial.flush() As suggested by @borisff in #4128. --- hardware/arduino/sam/cores/arduino/UARTClass.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware/arduino/sam/cores/arduino/UARTClass.cpp b/hardware/arduino/sam/cores/arduino/UARTClass.cpp index f8b80e970..ed1cb2687 100644 --- a/hardware/arduino/sam/cores/arduino/UARTClass.cpp +++ b/hardware/arduino/sam/cores/arduino/UARTClass.cpp @@ -138,7 +138,7 @@ void UARTClass::flush( void ) { while (_tx_buffer->_iHead != _tx_buffer->_iTail); //wait for transmit data to be sent // Wait for transmission to complete - while ((_pUart->UART_SR & UART_SR_TXRDY) != UART_SR_TXRDY) + while ((_pUart->UART_SR & UART_SR_TXEMPTY) != UART_SR_TXEMPTY) ; }