mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
boardprofile fallback to E32/S32
This commit is contained in:
@@ -1306,18 +1306,7 @@ bool System::load_board_profile(std::vector<int8_t> & data, const std::string &
|
|||||||
(int8_t)EMSESP::system_.eth_phy_addr_,
|
(int8_t)EMSESP::system_.eth_phy_addr_,
|
||||||
(int8_t)EMSESP::system_.eth_clock_mode_};
|
(int8_t)EMSESP::system_.eth_clock_mode_};
|
||||||
} else {
|
} else {
|
||||||
// unknown, use defaults and return false
|
// unknown, return false
|
||||||
data = {
|
|
||||||
EMSESP_DEFAULT_LED_GPIO,
|
|
||||||
EMSESP_DEFAULT_DALLAS_GPIO,
|
|
||||||
EMSESP_DEFAULT_RX_GPIO,
|
|
||||||
EMSESP_DEFAULT_TX_GPIO,
|
|
||||||
EMSESP_DEFAULT_PBUTTON_GPIO,
|
|
||||||
EMSESP_DEFAULT_PHY_TYPE,
|
|
||||||
-1, // power
|
|
||||||
0, // phy_addr,
|
|
||||||
0 // clock_mode
|
|
||||||
};
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,14 @@ StateUpdateResult WebSettings::update(JsonObject & root, WebSettings & settings)
|
|||||||
settings.board_profile = root["board_profile"] | EMSESP_DEFAULT_BOARD_PROFILE;
|
settings.board_profile = root["board_profile"] | EMSESP_DEFAULT_BOARD_PROFILE;
|
||||||
#endif
|
#endif
|
||||||
if (!System::load_board_profile(data, settings.board_profile.c_str())) {
|
if (!System::load_board_profile(data, settings.board_profile.c_str())) {
|
||||||
settings.board_profile = "CUSTOM";
|
// unknown, check for ethernet, use default E32/S32
|
||||||
|
if (ETH.begin(1, 16, 23, 18, ETH_PHY_LAN8720)) {
|
||||||
|
data = {2, 4, 5, 17, 33, PHY_type::PHY_TYPE_LAN8720, 16, 1, 0}; // BBQKees Gateway E32
|
||||||
|
settings.board_profile = "E32";
|
||||||
|
} else {
|
||||||
|
data = {2, 18, 23, 5, 0, PHY_type::PHY_TYPE_NONE, 0, 0, 0}; // BBQKees Gateway S32
|
||||||
|
settings.board_profile = "S32";
|
||||||
|
}
|
||||||
EMSESP::logger().info("No board profile found. Re-setting to %s", settings.board_profile.c_str());
|
EMSESP::logger().info("No board profile found. Re-setting to %s", settings.board_profile.c_str());
|
||||||
} else {
|
} else {
|
||||||
EMSESP::logger().info("Loading board profile %s", settings.board_profile.c_str());
|
EMSESP::logger().info("Loading board profile %s", settings.board_profile.c_str());
|
||||||
|
|||||||
Reference in New Issue
Block a user