From f155f9b0a4c8bbc27d34988cccb1dc4c5e18e7da Mon Sep 17 00:00:00 2001 From: Christian Spielberger Date: Sat, 30 Dec 2017 17:39:49 +0100 Subject: [PATCH] HardwareSerial: Fix for zero availableCharsCount in callback if there are more than 15 chars available. --- Sming/SmingCore/HardwareSerial.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sming/SmingCore/HardwareSerial.cpp b/Sming/SmingCore/HardwareSerial.cpp index 3b08f0aa82..49effca525 100644 --- a/Sming/SmingCore/HardwareSerial.cpp +++ b/Sming/SmingCore/HardwareSerial.cpp @@ -253,7 +253,7 @@ void HardwareSerial::commandProcessing(bool reqEnable) void HardwareSerial::delegateTask (os_event_t *inputEvent) { int uartNr = inputEvent->par >> 25; // the uart_nr is in the last byte - inputEvent->par = inputEvent->par & 0x0FFF; // clear the last bit + inputEvent->par = inputEvent->par & 0x00FFFFFF; // clear the last byte uint8 rcvChar = inputEvent->par % 256; // can be done by bitlogic, avoid casting from ETSParam uint16 charCount = inputEvent->par / 256 ;