Skip not used ESP32 GPIO init

This commit is contained in:
Theo Arends 2021-07-26 17:10:08 +02:00
parent e37290217e
commit e2b7cd96e6

View File

@ -1850,6 +1850,10 @@ void GpioInit(void)
pinMode(i, OUTPUT);
digitalWrite(i, 0);
}
/*
// Until 20210726
// Set any non-used GPIO to INPUT - Related to resetPins() in support_legacy_cores.ino
// Doing it here solves relay toggles at restart.
#if CONFIG_IDF_TARGET_ESP32C3
@ -1865,6 +1869,16 @@ void GpioInit(void)
}
}
#endif // CONFIG_IDF_TARGET_ESP32C3
*/
#ifdef ESP8266
// Set any non-used GPIO to INPUT - Related to resetPins() in support_legacy_cores.ino
// Doing it here solves relay toggles at restart.
else if (((i < 6) || (i > 11)) && (GPIO_NONE == mpin)) { // Skip SPI flash interface
if (!((1 == i) || (3 == i))) { // Skip serial
pinMode(i, INPUT);
}
}
#endif // ESP8266
}
// Digital input