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(
|
||||
ShellContext::MAIN,
|
||||
CommandFlags::ADMIN,
|
||||
string_vector{F_(set), F_(board_profile)},
|
||||
{F_(name_mandatory)},
|
||||
[](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::string board_profile = Helpers::toUpper(arguments.front());
|
||||
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, C3MINI, S2MINI, S3MINI, S32S3, CUSTOM)");
|
||||
return;
|
||||
}
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::ADMIN,
|
||||
string_vector{F_(set), F_(board_profile)},
|
||||
{F_(name_mandatory)},
|
||||
[](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::string board_profile = Helpers::toUpper(arguments.front());
|
||||
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, "
|
||||
"C3MINI, S2MINI, S3MINI, S32S3, CUSTOM)");
|
||||
return;
|
||||
}
|
||||
|
||||
EMSESP::webSettingsService.update([&](WebSettings & settings) {
|
||||
settings.board_profile = board_profile.c_str();
|
||||
settings.led_gpio = data[0];
|
||||
settings.dallas_gpio = data[1];
|
||||
settings.rx_gpio = data[2];
|
||||
settings.tx_gpio = data[3];
|
||||
settings.pbutton_gpio = data[4];
|
||||
settings.phy_type = data[5];
|
||||
settings.eth_power = data[6]; // can be -1
|
||||
settings.eth_phy_addr = data[7];
|
||||
settings.eth_clock_mode = data[8];
|
||||
return StateUpdateResult::CHANGED;
|
||||
});
|
||||
shell.printfln("Loaded board profile %s. Restarting...", board_profile.c_str());
|
||||
EMSESP::system_.system_restart();
|
||||
});
|
||||
EMSESP::webSettingsService.update([&](WebSettings & settings) {
|
||||
settings.board_profile = board_profile.c_str();
|
||||
settings.led_gpio = data[0];
|
||||
settings.dallas_gpio = data[1];
|
||||
settings.rx_gpio = data[2];
|
||||
settings.tx_gpio = data[3];
|
||||
settings.pbutton_gpio = data[4];
|
||||
settings.phy_type = data[5];
|
||||
settings.eth_power = data[6]; // can be -1
|
||||
settings.eth_phy_addr = data[7];
|
||||
settings.eth_clock_mode = data[8];
|
||||
return StateUpdateResult::CHANGED;
|
||||
});
|
||||
shell.printfln("Loaded board profile %s. Restarting...", board_profile.c_str());
|
||||
EMSESP::system_.system_restart();
|
||||
});
|
||||
|
||||
commands->add_command(
|
||||
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
|
||||
// (unless AP provision mode is Never — then stay on WIFI and keep waiting)
|
||||
NetPhase Network::initialPhase() const {
|
||||
bool eth_clock_conflicts_psram = ESP.getPsramSize()
|
||||
&& ((eth_clock_mode_t)eth_clock_mode_ == ETH_CLOCK_GPIO16_OUT || (eth_clock_mode_t)eth_clock_mode_ == ETH_CLOCK_GPIO17_OUT);
|
||||
bool eth_clock_conflicts_psram =
|
||||
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) {
|
||||
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;
|
||||
valid_system_gpios_ = {4, 34, 36, 12, 13, 21, 22, 25, 26, 27, 32, 33, 39};
|
||||
} 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};
|
||||
} else if (board_profile == "C3MINI") {
|
||||
#if defined(BOARD_C3_MINI_V1)
|
||||
|
||||
Reference in New Issue
Block a user