mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 11:16:34 +00:00
Merge pull request #13143 from barbudor/serial_console_swap
Serial.swap if TXD/RXD on GPIO13/15 (ESP8266)
This commit is contained in:
commit
9173175a2d
@ -1017,6 +1017,11 @@ void SetSerialBegin(void) {
|
||||
Serial.flush();
|
||||
#ifdef ESP8266
|
||||
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
|
||||
#ifdef ESP32
|
||||
delay(10); // Allow time to cleanup queues - if not used hangs ESP32
|
||||
|
@ -408,6 +408,14 @@ void setup(void) {
|
||||
BerryInit();
|
||||
#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);
|
||||
XsnsCall(FUNC_PRE_INIT);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user