1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-06 05:21:22 +03:00

Fix esp8266 HardwareSerial::flush

HardwareSerial::flush discarded data instead of waiting for it to be sent
This commit is contained in:
Ivan Grokhotkov 2015-01-16 17:28:36 +03:00
parent 7d1de31896
commit 4ef93a4f1e

View File

@ -299,9 +299,10 @@ void ICACHE_FLASH_ATTR HardwareSerial::flush()
{
if (!_written)
return;
uart0_flush(_uart);
_tx_buffer->flush();
_rx_buffer->flush();
while (_tx_buffer->getSize() || uart0_get_tx_fifo_room() < UART_TX_FIFO_SIZE)
yield();
_written = false;
}