From ed331a817a1f14f0a6bfe60d24f5bdc73843eafe Mon Sep 17 00:00:00 2001 From: chromhelm Date: Thu, 21 May 2015 21:42:40 +0200 Subject: [PATCH] Fixed bug with flushing --- hardware/arduino/avr/cores/arduino/HardwareSerial.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/hardware/arduino/avr/cores/arduino/HardwareSerial.cpp b/hardware/arduino/avr/cores/arduino/HardwareSerial.cpp index 41935e320..402269893 100644 --- a/hardware/arduino/avr/cores/arduino/HardwareSerial.cpp +++ b/hardware/arduino/avr/cores/arduino/HardwareSerial.cpp @@ -220,6 +220,7 @@ size_t HardwareSerial::write(uint8_t c) if (_tx_buffer_head == _tx_buffer_tail && bit_is_set(*_ucsra, UDRE0)) { *_udr = c; sbi(*_ucsra, TXC0); + _written = true; return 1; } tx_buffer_index_t i = (_tx_buffer_head + 1) % SERIAL_TX_BUFFER_SIZE;