mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 12:46:34 +00:00
Serial.swap if TXD/RXD on GPIO13/15 (ESP8266)
This commit is contained in:
parent
2dcf49ca38
commit
4fa80c1609
@ -1017,6 +1017,11 @@ void SetSerialBegin(void) {
|
|||||||
Serial.flush();
|
Serial.flush();
|
||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
Serial.begin(TasmotaGlobal.baudrate, (SerialConfig)pgm_read_byte(kTasmotaSerialConfig + Settings->serial_config));
|
Serial.begin(TasmotaGlobal.baudrate, (SerialConfig)pgm_read_byte(kTasmotaSerialConfig + Settings->serial_config));
|
||||||
|
if (15==Pin(GPIO_TXD,0) && 13==Pin(GPIO_RXD,0)) {
|
||||||
|
Serial.flush();
|
||||||
|
Serial.swap();
|
||||||
|
AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_SERIAL "Serial pins swapped to alternate"));
|
||||||
|
}
|
||||||
#endif // ESP8266
|
#endif // ESP8266
|
||||||
#ifdef ESP32
|
#ifdef ESP32
|
||||||
delay(10); // Allow time to cleanup queues - if not used hangs ESP32
|
delay(10); // Allow time to cleanup queues - if not used hangs ESP32
|
||||||
|
@ -408,6 +408,14 @@ void setup(void) {
|
|||||||
BerryInit();
|
BerryInit();
|
||||||
#endif // USE_BERRY
|
#endif // USE_BERRY
|
||||||
|
|
||||||
|
#ifdef ESP8266
|
||||||
|
if (15==Pin(GPIO_TXD,0) && 13==Pin(GPIO_RXD,0)) {
|
||||||
|
AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_SERIAL "Swapping Serial pins to alternate"));
|
||||||
|
Serial.flush();
|
||||||
|
Serial.swap();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
XdrvCall(FUNC_PRE_INIT);
|
XdrvCall(FUNC_PRE_INIT);
|
||||||
XsnsCall(FUNC_PRE_INIT);
|
XsnsCall(FUNC_PRE_INIT);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user