mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
stop crashing when ETH used and Analog Sensor is pin 21/SDA or 22/SCC (I2C conflict). Show when its a bad GPIO in log.
This commit is contained in:
@@ -440,6 +440,11 @@ bool System::is_valid_gpio(uint8_t pin, bool has_psram) {
|
||||
#endif
|
||||
return false; // bad pin
|
||||
}
|
||||
|
||||
// extra check for pins 21 and 22 (I2C) when ethernet is enabled
|
||||
if ((EMSESP::system_.ethernet_connected()) && (pin >= 21 && pin <= 22)) {
|
||||
return false; // bad pin
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user