mirror of https://github.com/arendst/Tasmota.git
Add flush before disabling tx (#17247)
This commit is contained in:
parent
bda32739a8
commit
1a6076c253
|
@ -460,6 +460,7 @@ size_t TasmotaSerial::write(uint8_t b) {
|
|||
size = 1;
|
||||
}
|
||||
if (m_tx_enable_pin > -1) {
|
||||
flush(); // Must wait for all data sent
|
||||
digitalWrite(m_tx_enable_pin, LOW);
|
||||
}
|
||||
return size;
|
||||
|
|
|
@ -171,6 +171,7 @@ uint8_t TasmotaModbus::Send(uint8_t device_address, uint8_t function_code, uint1
|
|||
write(frame, framepointer);
|
||||
#ifdef TASMOTA_MODBUS_TX_ENABLE
|
||||
if (mb_tx_enable_pin > -1) {
|
||||
flush(); // Must wait for all data sent
|
||||
digitalWrite(mb_tx_enable_pin, LOW);
|
||||
}
|
||||
#endif // TASMOTA_MODBUS_TX_ENABLE
|
||||
|
|
Loading…
Reference in New Issue