diff --git a/lib/TasmotaSerial-2.3.0/README.md b/lib/TasmotaSerial-2.3.1/README.md similarity index 100% rename from lib/TasmotaSerial-2.3.0/README.md rename to lib/TasmotaSerial-2.3.1/README.md diff --git a/lib/TasmotaSerial-2.3.0/examples/swsertest/swsertest.ino b/lib/TasmotaSerial-2.3.1/examples/swsertest/swsertest.ino similarity index 100% rename from lib/TasmotaSerial-2.3.0/examples/swsertest/swsertest.ino rename to lib/TasmotaSerial-2.3.1/examples/swsertest/swsertest.ino diff --git a/lib/TasmotaSerial-2.3.0/keywords.txt b/lib/TasmotaSerial-2.3.1/keywords.txt similarity index 100% rename from lib/TasmotaSerial-2.3.0/keywords.txt rename to lib/TasmotaSerial-2.3.1/keywords.txt diff --git a/lib/TasmotaSerial-2.3.0/library.json b/lib/TasmotaSerial-2.3.1/library.json similarity index 100% rename from lib/TasmotaSerial-2.3.0/library.json rename to lib/TasmotaSerial-2.3.1/library.json diff --git a/lib/TasmotaSerial-2.3.0/library.properties b/lib/TasmotaSerial-2.3.1/library.properties similarity index 100% rename from lib/TasmotaSerial-2.3.0/library.properties rename to lib/TasmotaSerial-2.3.1/library.properties diff --git a/lib/TasmotaSerial-2.3.0/src/TasmotaSerial.cpp b/lib/TasmotaSerial-2.3.1/src/TasmotaSerial.cpp similarity index 97% rename from lib/TasmotaSerial-2.3.0/src/TasmotaSerial.cpp rename to lib/TasmotaSerial-2.3.1/src/TasmotaSerial.cpp index eecdeb124..d99137edc 100644 --- a/lib/TasmotaSerial-2.3.0/src/TasmotaSerial.cpp +++ b/lib/TasmotaSerial-2.3.1/src/TasmotaSerial.cpp @@ -100,7 +100,7 @@ TasmotaSerial::TasmotaSerial(int receive_pin, int transmit_pin, int hardware_fal m_buffer = (uint8_t*)malloc(TM_SERIAL_BUFFER_SIZE); if (m_buffer == NULL) return; // Use getCycleCount() loop to get as exact timing as possible - m_bit_time = F_CPU / TM_SERIAL_BAUDRATE; + m_bit_time = ESP.getCpuFreqMHz() * 1000000 / TM_SERIAL_BAUDRATE; pinMode(m_rx_pin, INPUT); tms_obj_list[m_rx_pin] = this; attachInterrupt(m_rx_pin, ISRList[m_rx_pin], FALLING); @@ -145,8 +145,8 @@ bool TasmotaSerial::begin(long speed, int stop_bits) { } } else { // Use getCycleCount() loop to get as exact timing as possible - m_bit_time = F_CPU / speed; - m_high_speed = (speed > 9600); + m_bit_time = ESP.getCpuFreqMHz() * 1000000 / speed; + m_high_speed = (speed >= 9600); } return m_valid; } diff --git a/lib/TasmotaSerial-2.3.0/src/TasmotaSerial.h b/lib/TasmotaSerial-2.3.1/src/TasmotaSerial.h similarity index 100% rename from lib/TasmotaSerial-2.3.0/src/TasmotaSerial.h rename to lib/TasmotaSerial-2.3.1/src/TasmotaSerial.h