mirror of
https://github.com/arendst/Tasmota.git
synced 2025-04-25 15:27:17 +00:00
Fix TasmotaSerial
Fix TasmotaSerial
This commit is contained in:
parent
d3997b2851
commit
50e37b43c6
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "TasmotaSerial",
|
||||
"version": "2.3.5",
|
||||
"version": "2.4.0",
|
||||
"keywords": [
|
||||
"serial", "io", "TasmotaSerial"
|
||||
],
|
@ -1,5 +1,5 @@
|
||||
name=TasmotaSerial
|
||||
version=2.3.5
|
||||
version=2.4.0
|
||||
author=Theo Arends
|
||||
maintainer=Theo Arends <theo@arends.com>
|
||||
sentence=Implementation of software serial with hardware serial fallback for ESP8266.
|
@ -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++) {
|
Loading…
x
Reference in New Issue
Block a user