mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
ethernet working with arduino_3.0
This commit is contained in:
@@ -730,7 +730,11 @@ void System::network_init(bool refresh) {
|
|||||||
// ETH_CLOCK_GPIO17_OUT = 3 RMII clock output from GPIO17, for 50hz inverted clock
|
// ETH_CLOCK_GPIO17_OUT = 3 RMII clock output from GPIO17, for 50hz inverted clock
|
||||||
auto clock_mode = (eth_clock_mode_t)eth_clock_mode_;
|
auto clock_mode = (eth_clock_mode_t)eth_clock_mode_;
|
||||||
|
|
||||||
eth_present_ = ETH.begin((eth_phy_type_t)phy_addr, power, mdc, mdio, type, clock_mode);
|
#if ESP_ARDUINO_VERSION_MAJOR < 3
|
||||||
|
eth_present_ = ETH.begin(phy_addr, power, mdc, mdio, type, clock_mode);
|
||||||
|
#else
|
||||||
|
eth_present_ = ETH.begin(type, phy_addr, mdc, mdio, power, clock_mode);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -109,13 +109,21 @@ StateUpdateResult WebSettings::update(JsonObject & root, WebSettings & settings)
|
|||||||
if (!System::load_board_profile(data, settings.board_profile.c_str())) {
|
if (!System::load_board_profile(data, settings.board_profile.c_str())) {
|
||||||
#if CONFIG_IDF_TARGET_ESP32 && !defined(EMSESP_STANDALONE)
|
#if CONFIG_IDF_TARGET_ESP32 && !defined(EMSESP_STANDALONE)
|
||||||
if (settings.board_profile == "") { // empty: new test
|
if (settings.board_profile == "") { // empty: new test
|
||||||
if (ETH.begin((eth_phy_type_t)1, 16, 23, 18, ETH_PHY_LAN8720, ETH_CLOCK_GPIO0_IN)) {
|
#if ESP_ARDUINO_VERSION_MAJOR < 3
|
||||||
|
if (ETH.begin(1, 16, 23, 18, ETH_PHY_LAN8720, ETH_CLOCK_GPIO0_IN)) {
|
||||||
|
#else
|
||||||
|
if (ETH.begin(ETH_PHY_LAN8720, 1, 23, 18, 16, ETH_CLOCK_GPIO0_IN)) {
|
||||||
|
#endif
|
||||||
EMSESP::nvs_.putString("boot", "E32");
|
EMSESP::nvs_.putString("boot", "E32");
|
||||||
} else {
|
} else {
|
||||||
EMSESP::nvs_.putString("boot", "Test");
|
EMSESP::nvs_.putString("boot", "Test");
|
||||||
}
|
}
|
||||||
} else if (settings.board_profile == "Test") {
|
} else if (settings.board_profile == "Test") {
|
||||||
if (ETH.begin((eth_phy_type_t)0, 15, 23, 18, ETH_PHY_LAN8720, ETH_CLOCK_GPIO0_OUT)) {
|
#if ESP_ARDUINO_VERSION_MAJOR < 3
|
||||||
|
if (ETH.begin(0, 15, 23, 18, ETH_PHY_LAN8720, ETH_CLOCK_GPIO0_OUT)) {
|
||||||
|
#else
|
||||||
|
if (ETH.begin(ETH_PHY_LAN8720, 0, 23, 18, 15, ETH_CLOCK_GPIO0_OUT)) {
|
||||||
|
#endif
|
||||||
EMSESP::nvs_.putString("boot", "E32V2");
|
EMSESP::nvs_.putString("boot", "E32V2");
|
||||||
} else {
|
} else {
|
||||||
EMSESP::nvs_.putString("boot", "S32");
|
EMSESP::nvs_.putString("boot", "S32");
|
||||||
|
|||||||
Reference in New Issue
Block a user