mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
check for Eth boards with no PHY power-pin (-1)
This commit is contained in:
@@ -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
|
// reset power and add a delay as ETH doesn't not always start up correctly after a warm boot
|
||||||
// TODO still experimental
|
// TODO still experimental
|
||||||
pinMode(eth_power_, OUTPUT);
|
if (eth_power_ != -1) {
|
||||||
digitalWrite(eth_power_, LOW);
|
pinMode(eth_power_, OUTPUT);
|
||||||
delay(1000);
|
digitalWrite(eth_power_, LOW);
|
||||||
digitalWrite(eth_power_, HIGH);
|
delay(500);
|
||||||
|
digitalWrite(eth_power_, HIGH);
|
||||||
|
}
|
||||||
|
|
||||||
#if ESP_IDF_VERSION_MAJOR < 5
|
#if ESP_IDF_VERSION_MAJOR < 5
|
||||||
eth_present_ = ETH.begin(phy_addr, power, mdc, mdio, type, clock_mode);
|
eth_present_ = ETH.begin(phy_addr, power, mdc, mdio, type, clock_mode);
|
||||||
|
|||||||
Reference in New Issue
Block a user