check for Eth boards with no PHY power-pin (-1)

This commit is contained in:
proddy
2024-09-17 10:22:05 +02:00
parent 7fe68d9db3
commit 869ba98d6e

View File

@@ -790,10 +790,12 @@ void System::network_init(bool refresh) {
// reset power and add a delay as ETH doesn't not always start up correctly after a warm boot
// TODO still experimental
pinMode(eth_power_, OUTPUT);
digitalWrite(eth_power_, LOW);
delay(1000);
digitalWrite(eth_power_, HIGH);
if (eth_power_ != -1) {
pinMode(eth_power_, OUTPUT);
digitalWrite(eth_power_, LOW);
delay(500);
digitalWrite(eth_power_, HIGH);
}
#if ESP_IDF_VERSION_MAJOR < 5
eth_present_ = ETH.begin(phy_addr, power, mdc, mdio, type, clock_mode);