1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +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) if (!_written)
return; return;
uart0_flush(_uart);
_tx_buffer->flush(); while (_tx_buffer->getSize() || uart0_get_tx_fifo_room() < UART_TX_FIFO_SIZE)
_rx_buffer->flush(); yield();
_written = false; _written = false;
} }