mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-09-13 21:54:07 +00:00
auto-formatting
This commit is contained in:
+28
-29
@@ -295,36 +295,35 @@ static void setup_commands(std::shared_ptr<Commands> const & commands) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
commands->add_command(
|
commands->add_command(ShellContext::MAIN,
|
||||||
ShellContext::MAIN,
|
CommandFlags::ADMIN,
|
||||||
CommandFlags::ADMIN,
|
string_vector{F_(set), F_(board_profile)},
|
||||||
string_vector{F_(set), F_(board_profile)},
|
{F_(name_mandatory)},
|
||||||
{F_(name_mandatory)},
|
[](Shell & shell, const std::vector<std::string> & arguments) {
|
||||||
[](Shell & shell, const std::vector<std::string> & arguments) {
|
std::vector<int8_t> data; // led, dallas, rx, tx, button, phy_type, eth_power, eth_phy_addr, eth_clock_mode
|
||||||
std::vector<int8_t> data; // led, dallas, rx, tx, button, phy_type, eth_power, eth_phy_addr, eth_clock_mode
|
std::string board_profile = Helpers::toUpper(arguments.front());
|
||||||
std::string board_profile = Helpers::toUpper(arguments.front());
|
if (!EMSESP::system_.load_board_profile(data, board_profile)) {
|
||||||
if (!EMSESP::system_.load_board_profile(data, board_profile)) {
|
shell.println("Invalid board profile (S32, E32, E32V2, E32V2_2, MH-ET, NODEMCU, LOLIN, OLIMEX, OLIMEXPOE, OLIMEXPOEW, "
|
||||||
shell.println(
|
"C3MINI, S2MINI, S3MINI, S32S3, CUSTOM)");
|
||||||
"Invalid board profile (S32, E32, E32V2, E32V2_2, MH-ET, NODEMCU, LOLIN, OLIMEX, OLIMEXPOE, OLIMEXPOEW, C3MINI, S2MINI, S3MINI, S32S3, CUSTOM)");
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
EMSESP::webSettingsService.update([&](WebSettings & settings) {
|
EMSESP::webSettingsService.update([&](WebSettings & settings) {
|
||||||
settings.board_profile = board_profile.c_str();
|
settings.board_profile = board_profile.c_str();
|
||||||
settings.led_gpio = data[0];
|
settings.led_gpio = data[0];
|
||||||
settings.dallas_gpio = data[1];
|
settings.dallas_gpio = data[1];
|
||||||
settings.rx_gpio = data[2];
|
settings.rx_gpio = data[2];
|
||||||
settings.tx_gpio = data[3];
|
settings.tx_gpio = data[3];
|
||||||
settings.pbutton_gpio = data[4];
|
settings.pbutton_gpio = data[4];
|
||||||
settings.phy_type = data[5];
|
settings.phy_type = data[5];
|
||||||
settings.eth_power = data[6]; // can be -1
|
settings.eth_power = data[6]; // can be -1
|
||||||
settings.eth_phy_addr = data[7];
|
settings.eth_phy_addr = data[7];
|
||||||
settings.eth_clock_mode = data[8];
|
settings.eth_clock_mode = data[8];
|
||||||
return StateUpdateResult::CHANGED;
|
return StateUpdateResult::CHANGED;
|
||||||
});
|
});
|
||||||
shell.printfln("Loaded board profile %s. Restarting...", board_profile.c_str());
|
shell.printfln("Loaded board profile %s. Restarting...", board_profile.c_str());
|
||||||
EMSESP::system_.system_restart();
|
EMSESP::system_.system_restart();
|
||||||
});
|
});
|
||||||
|
|
||||||
commands->add_command(
|
commands->add_command(
|
||||||
ShellContext::MAIN,
|
ShellContext::MAIN,
|
||||||
|
|||||||
@@ -229,8 +229,8 @@ void Network::reconnect() {
|
|||||||
// boards without an Ethernet PHY skip straight to WIFI; without a configured SSID, straight to AP
|
// boards without an Ethernet PHY skip straight to WIFI; without a configured SSID, straight to AP
|
||||||
// (unless AP provision mode is Never — then stay on WIFI and keep waiting)
|
// (unless AP provision mode is Never — then stay on WIFI and keep waiting)
|
||||||
NetPhase Network::initialPhase() const {
|
NetPhase Network::initialPhase() const {
|
||||||
bool eth_clock_conflicts_psram = ESP.getPsramSize()
|
bool eth_clock_conflicts_psram =
|
||||||
&& ((eth_clock_mode_t)eth_clock_mode_ == ETH_CLOCK_GPIO16_OUT || (eth_clock_mode_t)eth_clock_mode_ == ETH_CLOCK_GPIO17_OUT);
|
ESP.getPsramSize() && ((eth_clock_mode_t)eth_clock_mode_ == ETH_CLOCK_GPIO16_OUT || (eth_clock_mode_t)eth_clock_mode_ == ETH_CLOCK_GPIO17_OUT);
|
||||||
if (phy_type_ != PHY_type::PHY_TYPE_NONE && !eth_clock_conflicts_psram) {
|
if (phy_type_ != PHY_type::PHY_TYPE_NONE && !eth_clock_conflicts_psram) {
|
||||||
return NetPhase::ETHERNET;
|
return NetPhase::ETHERNET;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -2823,7 +2823,7 @@ bool System::load_board_profile(std::vector<int8_t> & data, const std::string &
|
|||||||
// uart0 = 1, 3; SD-card = 2, 14, 15; button = 34;
|
// uart0 = 1, 3; SD-card = 2, 14, 15; button = 34;
|
||||||
valid_system_gpios_ = {4, 34, 36, 12, 13, 21, 22, 25, 26, 27, 32, 33, 39};
|
valid_system_gpios_ = {4, 34, 36, 12, 13, 21, 22, 25, 26, 27, 32, 33, 39};
|
||||||
} else if (board_profile == "OLIMEXPOEW") {
|
} else if (board_profile == "OLIMEXPOEW") {
|
||||||
data = {0, 0, 36, 4, 34, PHY_type::PHY_TYPE_LAN8720, 12, 0, 1, 0}; // Olimex ESP32-POE-ISO WROVER (PSRAM)
|
data = {0, 0, 36, 4, 34, PHY_type::PHY_TYPE_LAN8720, 12, 0, 1, 0}; // Olimex ESP32-POE-ISO WROVER (PSRAM)
|
||||||
valid_system_gpios_ = {4, 34, 36, 12, 13, 21, 22, 25, 26, 27, 32, 33, 39};
|
valid_system_gpios_ = {4, 34, 36, 12, 13, 21, 22, 25, 26, 27, 32, 33, 39};
|
||||||
} else if (board_profile == "C3MINI") {
|
} else if (board_profile == "C3MINI") {
|
||||||
#if defined(BOARD_C3_MINI_V1)
|
#if defined(BOARD_C3_MINI_V1)
|
||||||
|
|||||||
Reference in New Issue
Block a user