Skip to content

Commit cde84d7

Browse files
gickingfpistm
authored andcommitted
fix: SoftwareSerial flush() issue
Fixes #2904. Signed-off-by: gicking <[email protected]>
1 parent e531ea8 commit cde84d7

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)