1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-18 07:52:14 +01:00

Check TXEMPTY flag instead of TXRDY flag on Serial.flush()

As suggested by @borisff in #4128.
This commit is contained in:
Sandeep Mistry 2015-11-17 13:20:11 -05:00
parent d0bd09c8d3
commit 435f6790da

View File

@ -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)
;
}