diff --git a/lib/TasmotaSerial-2.3.5/README.md b/lib/TasmotaSerial-2.4.0/README.md similarity index 100% rename from lib/TasmotaSerial-2.3.5/README.md rename to lib/TasmotaSerial-2.4.0/README.md diff --git a/lib/TasmotaSerial-2.3.5/examples/swsertest/swsertest.ino b/lib/TasmotaSerial-2.4.0/examples/swsertest/swsertest.ino similarity index 100% rename from lib/TasmotaSerial-2.3.5/examples/swsertest/swsertest.ino rename to lib/TasmotaSerial-2.4.0/examples/swsertest/swsertest.ino diff --git a/lib/TasmotaSerial-2.3.5/keywords.txt b/lib/TasmotaSerial-2.4.0/keywords.txt similarity index 100% rename from lib/TasmotaSerial-2.3.5/keywords.txt rename to lib/TasmotaSerial-2.4.0/keywords.txt diff --git a/lib/TasmotaSerial-2.3.5/library.json b/lib/TasmotaSerial-2.4.0/library.json similarity index 94% rename from lib/TasmotaSerial-2.3.5/library.json rename to lib/TasmotaSerial-2.4.0/library.json index d02a3b72b..cdce0deba 100644 --- a/lib/TasmotaSerial-2.3.5/library.json +++ b/lib/TasmotaSerial-2.4.0/library.json @@ -1,6 +1,6 @@ { "name": "TasmotaSerial", - "version": "2.3.5", + "version": "2.4.0", "keywords": [ "serial", "io", "TasmotaSerial" ], diff --git a/lib/TasmotaSerial-2.3.5/library.properties b/lib/TasmotaSerial-2.4.0/library.properties similarity index 94% rename from lib/TasmotaSerial-2.3.5/library.properties rename to lib/TasmotaSerial-2.4.0/library.properties index 5ac7b2a63..f1486dfab 100644 --- a/lib/TasmotaSerial-2.3.5/library.properties +++ b/lib/TasmotaSerial-2.4.0/library.properties @@ -1,5 +1,5 @@ name=TasmotaSerial -version=2.3.5 +version=2.4.0 author=Theo Arends maintainer=Theo Arends sentence=Implementation of software serial with hardware serial fallback for ESP8266. diff --git a/lib/TasmotaSerial-2.3.5/src/TasmotaSerial.cpp b/lib/TasmotaSerial-2.4.0/src/TasmotaSerial.cpp similarity index 93% rename from lib/TasmotaSerial-2.3.5/src/TasmotaSerial.cpp rename to lib/TasmotaSerial-2.4.0/src/TasmotaSerial.cpp index ece6b9937..c2672f514 100644 --- a/lib/TasmotaSerial-2.3.5/src/TasmotaSerial.cpp +++ b/lib/TasmotaSerial-2.4.0/src/TasmotaSerial.cpp @@ -212,12 +212,12 @@ int TasmotaSerial::available() } #ifdef TM_SERIAL_USE_IRAM -#define TM_SERIAL_WAIT_SND { while (ESP.getCycleCount() < wait + start) if (!m_high_speed) optimistic_yield(1); wait += m_bit_time; } // Watchdog timeouts -#define TM_SERIAL_WAIT_RCV { while (ESP.getCycleCount() < wait + start); wait += m_bit_time; } -#define TM_SERIAL_WAIT_RCV_LOOP { while (ESP.getCycleCount() < wait + start); } +#define TM_SERIAL_WAIT_SND { while (ESP.getCycleCount() < (wait + start)) if (!m_high_speed) optimistic_yield(1); wait += m_bit_time; } // Watchdog timeouts +#define TM_SERIAL_WAIT_RCV { while (ESP.getCycleCount() < (wait + start)); wait += m_bit_time; } +#define TM_SERIAL_WAIT_RCV_LOOP { while (ESP.getCycleCount() < (wait + start)); } #else -#define TM_SERIAL_WAIT_SND { while (ESP.getCycleCount() < wait + start); wait += m_bit_time; } -#define TM_SERIAL_WAIT_RCV { while (ESP.getCycleCount() < wait + start); wait += m_bit_time; } +#define TM_SERIAL_WAIT_SND { while (ESP.getCycleCount() < (wait + start)); wait += m_bit_time; } +#define TM_SERIAL_WAIT_RCV { while (ESP.getCycleCount() < (wait + start)); wait += m_bit_time; } #endif size_t TasmotaSerial::write(uint8_t b) @@ -277,8 +277,13 @@ void TasmotaSerial::rxRead() } TM_SERIAL_WAIT_RCV_LOOP; // wait for stop bit + if (2 == m_stop_bits) { + wait += m_bit_time; + TM_SERIAL_WAIT_RCV_LOOP; + } wait += m_bit_time / 4; - if (loop <= 0) { break; } // exit now if not very high speed or buffer full + + if (loop_read <= 0) { break; } // exit now if not very high speed or buffer full bool start_of_next_byte = false; for (uint32_t i = 0; i < 12; i++) { diff --git a/lib/TasmotaSerial-2.3.5/src/TasmotaSerial.h b/lib/TasmotaSerial-2.4.0/src/TasmotaSerial.h similarity index 100% rename from lib/TasmotaSerial-2.3.5/src/TasmotaSerial.h rename to lib/TasmotaSerial-2.4.0/src/TasmotaSerial.h