Be more specific to target ESP32

This commit is contained in:
Stephan Hadinger 2022-08-31 10:12:25 +02:00
parent b355231721
commit 74cbc47614

View File

@ -154,7 +154,7 @@ void EthernetInit(void) {
int eth_power = Pin(GPIO_ETH_PHY_POWER); int eth_power = Pin(GPIO_ETH_PHY_POWER);
int eth_mdc = Pin(GPIO_ETH_PHY_MDC); int eth_mdc = Pin(GPIO_ETH_PHY_MDC);
int eth_mdio = Pin(GPIO_ETH_PHY_MDIO); int eth_mdio = Pin(GPIO_ETH_PHY_MDIO);
#ifdef ESP32 #if CONFIG_IDF_TARGET_ESP32
// fix an disconnection issue after rebooting Olimex POE - this forces a clean state for all GPIO involved in RMII // fix an disconnection issue after rebooting Olimex POE - this forces a clean state for all GPIO involved in RMII
gpio_reset_pin((gpio_num_t)GPIO_ETH_PHY_POWER); gpio_reset_pin((gpio_num_t)GPIO_ETH_PHY_POWER);
gpio_reset_pin((gpio_num_t)GPIO_ETH_PHY_MDC); gpio_reset_pin((gpio_num_t)GPIO_ETH_PHY_MDC);
@ -178,7 +178,7 @@ void EthernetInit(void) {
break; break;
} }
delay(1); delay(1);
#endif #endif // CONFIG_IDF_TARGET_ESP32
if (!ETH.begin(Settings->eth_address, eth_power, eth_mdc, eth_mdio, (eth_phy_type_t)Settings->eth_type, (eth_clock_mode_t)Settings->eth_clk_mode)) { if (!ETH.begin(Settings->eth_address, eth_power, eth_mdc, eth_mdio, (eth_phy_type_t)Settings->eth_type, (eth_clock_mode_t)Settings->eth_clk_mode)) {
AddLog(LOG_LEVEL_DEBUG, PSTR("ETH: Bad PHY type or init error")); AddLog(LOG_LEVEL_DEBUG, PSTR("ETH: Bad PHY type or init error"));
return; return;