From 65908208d4cdf8fc08caa82e853c12c2328e455a Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Thu, 16 Dec 2021 14:34:00 +0100 Subject: [PATCH] Changes for new idf --- src/espwifistack.cpp | 29 ++++++++++------------------- src/espwifistackconfig.h | 2 +- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/espwifistack.cpp b/src/espwifistack.cpp index 292b1a7..21de61e 100644 --- a/src/espwifistack.cpp +++ b/src/espwifistack.cpp @@ -2580,12 +2580,12 @@ tl::expected eth_begin(const config &config, const eth_config return tl::make_unexpected(std::move(msg)); } - if (const auto result = esp_eth_set_default_handlers(esp_netifs[ESP_IF_ETH]); result != ESP_OK) - { - auto msg = fmt::format("esp_eth_set_default_handlers() failed with {}", esp_err_to_name(result)); - ESP_LOGE(TAG, "%.*s", msg.size(), msg.data()); - return tl::make_unexpected(std::move(msg)); - } +// if (const auto result = esp_eth_set_default_handlers(esp_netifs[ESP_IF_ETH]); result != ESP_OK) +// { +// auto msg = fmt::format("esp_eth_set_default_handlers() failed with {}", esp_err_to_name(result)); +// ESP_LOGE(TAG, "%.*s", msg.size(), msg.data()); +// return tl::make_unexpected(std::move(msg)); +// } esp_eth_mac_t *eth_mac{}; @@ -2626,8 +2626,8 @@ tl::expected eth_begin(const config &config, const eth_config switch (eth.type) { - case ETH_PHY_LAN8720: - eth_phy = esp_eth_phy_new_lan8720(&phy_config); + case ETH_PHY_LAN87XX: + eth_phy = esp_eth_phy_new_lan87xx(&phy_config); if (!eth_phy) { auto msg = std::string{"esp_eth_phy_new_lan8720() failed"}; @@ -2673,8 +2673,8 @@ tl::expected eth_begin(const config &config, const eth_config } break; #endif - case ETH_PHY_KSZ8041: - eth_phy = esp_eth_phy_new_ksz8041(&phy_config); + case ETH_PHY_KSZ80XX: + eth_phy = esp_eth_phy_new_ksz80xx(&phy_config); if (!eth_phy) { auto msg = std::string{"esp_eth_phy_new_ksz8041() failed"}; @@ -2682,15 +2682,6 @@ tl::expected eth_begin(const config &config, const eth_config return tl::make_unexpected(std::move(msg)); } break; -// case ETH_PHY_KSZ8081: -// eth_phy = esp_eth_phy_new_ksz8081(&phy_config); -// if (!eth_phy) -// { -// auto msg = std::string{"esp_eth_phy_new_ksz8081() failed"}; -// ESP_LOGE(TAG, "%.*s", msg.size(), msg.data()); -// return tl::make_unexpected(std::move(msg)); -// } -// break; default: auto msg = fmt::format("unknown type {}", eth.type); ESP_LOGE(TAG, "%.*s", msg.size(), msg.data()); diff --git a/src/espwifistackconfig.h b/src/espwifistackconfig.h index 64830d7..099a655 100644 --- a/src/espwifistackconfig.h +++ b/src/espwifistackconfig.h @@ -196,7 +196,7 @@ struct ap_config enum eth_clock_mode_t { ETH_CLOCK_GPIO0_IN, ETH_CLOCK_GPIO0_OUT, ETH_CLOCK_GPIO16_OUT, ETH_CLOCK_GPIO17_OUT }; -enum eth_phy_type_t { ETH_PHY_LAN8720, ETH_PHY_TLK110, ETH_PHY_RTL8201, ETH_PHY_DP83848, ETH_PHY_DM9051, ETH_PHY_KSZ8041, /* ETH_PHY_KSZ8081, */ ETH_PHY_MAX }; +enum eth_phy_type_t { ETH_PHY_LAN87XX, ETH_PHY_TLK110, ETH_PHY_RTL8201, ETH_PHY_DP83848, ETH_PHY_DM9051, ETH_PHY_KSZ80XX, ETH_PHY_MAX }; struct eth_config {