Fix GPIO16 as Transmit enable pin (#21269)

This commit is contained in:
Theo Arends 2024-06-02 17:15:11 +02:00
parent 132b98f0c2
commit fd02f5aefc
1 changed files with 5 additions and 0 deletions

View File

@ -136,7 +136,12 @@ bool TasmotaSerial::isValidGPIOpin(int pin) {
} }
void TasmotaSerial::setTransmitEnablePin(int tx_enable_pin) { void TasmotaSerial::setTransmitEnablePin(int tx_enable_pin) {
#ifdef ESP8266
if ((tx_enable_pin > -1) && (isValidGPIOpin(tx_enable_pin) || (16 == tx_enable_pin))) {
#endif
#ifdef ESP32
if ((tx_enable_pin > -1) && isValidGPIOpin(tx_enable_pin)) { if ((tx_enable_pin > -1) && isValidGPIOpin(tx_enable_pin)) {
#endif
m_tx_enable_pin = tx_enable_pin; m_tx_enable_pin = tx_enable_pin;
pinMode(m_tx_enable_pin, OUTPUT); pinMode(m_tx_enable_pin, OUTPUT);
digitalWrite(m_tx_enable_pin, LOW); digitalWrite(m_tx_enable_pin, LOW);