From 604e6d58f05334c49737f02ba881d348f2a0cf2e Mon Sep 17 00:00:00 2001 From: josesimoes Date: Thu, 2 May 2024 08:51:58 +0100 Subject: [PATCH] Fix watchcar on RX handler --- .../sys_io_ser_native_System_IO_Ports_SerialPort.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/targets/TI_SimpleLink/_nanoCLR/System.IO.Ports/sys_io_ser_native_System_IO_Ports_SerialPort.cpp b/targets/TI_SimpleLink/_nanoCLR/System.IO.Ports/sys_io_ser_native_System_IO_Ports_SerialPort.cpp index 4d71c35171..2eaad37357 100644 --- a/targets/TI_SimpleLink/_nanoCLR/System.IO.Ports/sys_io_ser_native_System_IO_Ports_SerialPort.cpp +++ b/targets/TI_SimpleLink/_nanoCLR/System.IO.Ports/sys_io_ser_native_System_IO_Ports_SerialPort.cpp @@ -127,14 +127,12 @@ void SerialRxTask(UArg a0, UArg a1) size_t bufferIndex = 0; uint8_t input; size_t bytesRead; - bool watchCharFound = false; int_fast16_t status = 1; NF_PAL_UART *palUart = GetPalUartFromUartNum((int)a0); while (1) { - status = UART2_read(palUart->UartDriver, &input, 1, &bytesRead); if (status == UART2_STATUS_SUCCESS) @@ -151,7 +149,7 @@ void SerialRxTask(UArg a0, UArg a1) // yes // check if the requested bytes are available in the buffer... //... or if the watch char was received - if (palUart->RxRingBuffer.Length() >= palUart->RxBytesToRead || watchCharFound) + if (palUart->RxRingBuffer.Length() >= palUart->RxBytesToRead || (input == palUart->WatchChar)) { // reset Rx bytes to read count palUart->RxBytesToRead = 0;