Skip to content

Commit 49eeebd

Browse files
committed
bugfix SoftwareSerial.flush(), see #2904
1 parent 3012ea8 commit 49eeebd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libraries/SoftwareSerial/src/SoftwareSerial.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,8 @@ void SoftwareSerial::flush()
409409
noInterrupts();
410410
_receive_buffer_head = _receive_buffer_tail = 0;
411411
interrupts();
412+
// wait for previous transmit to complete
413+
while (active_out);
412414
}
413415

414416
int SoftwareSerial::peek()

0 commit comments

Comments
 (0)