From 33741c1bb205ccf093cec5e1a396dc48a7dcc3b3 Mon Sep 17 00:00:00 2001 From: David Crocker Date: Tue, 15 Jun 2021 21:51:30 +0100 Subject: [PATCH] Fix to serial receive buffer overflow handling --- src/SAM4S_4E_E70/AsyncSerial.cpp | 2 +- src/SAME5x_C21/AsyncSerial.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SAM4S_4E_E70/AsyncSerial.cpp b/src/SAM4S_4E_E70/AsyncSerial.cpp index 9bccae1b..9597204d 100644 --- a/src/SAM4S_4E_E70/AsyncSerial.cpp +++ b/src/SAM4S_4E_E70/AsyncSerial.cpp @@ -207,7 +207,7 @@ void AsyncSerial::IrqHandler() noexcept if (bufferOverrunPending) { - if (txBuffer.PutItem(0x7F)) + if (rxBuffer.PutItem(0x7F)) { bufferOverrunPending = false; (void)rxBuffer.PutItem(c); // we don't much care whether this succeeds or not diff --git a/src/SAME5x_C21/AsyncSerial.cpp b/src/SAME5x_C21/AsyncSerial.cpp index b7e9f0f2..26b7c2cb 100644 --- a/src/SAME5x_C21/AsyncSerial.cpp +++ b/src/SAME5x_C21/AsyncSerial.cpp @@ -209,7 +209,7 @@ void AsyncSerial::Interrupt2() noexcept if (bufferOverrunPending) { - if (txBuffer.PutItem(0x7F)) + if (rxBuffer.PutItem(0x7F)) { bufferOverrunPending = false; (void)rxBuffer.PutItem(c); // we don't much care whether this succeeds or not