Skip to content

Commit b2f0b49

Browse files
committed
receive-mp3.ino: add flush
1 parent bab7e32 commit b2f0b49

File tree

1 file changed

+2
-0
lines changed
  • examples/examples-communication/serial/mp3-xon-xoff/receive-mp3

1 file changed

+2
-0
lines changed

examples/examples-communication/serial/mp3-xon-xoff/receive-mp3/receive-mp3.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ void setup() {
5454
// data synchronization to prevent buffer overflow
5555
if (buffer.levelPercent() >= max_percent) {
5656
Serial1.write(xoff); // stop receiving
57+
Serial1.flush();
5758
} else if (buffer.levelPercent() <= min_percent) {
5859
Serial1.write(xon); // start receiving
60+
Serial1.flush();
5961
}
6062
});
6163
}

0 commit comments

Comments
 (0)