Skip to content

Commit 0c76ed2

Browse files
committed
custom board profile is allowed
1 parent 8bac9f6 commit 0c76ed2

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/WebSettingsService.cpp

+3-7
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,13 @@ void WebSettings::read(WebSettings & settings, JsonObject & root) {
6262

6363
// call on initialization and also when settings are updated via web or console
6464
StateUpdateResult WebSettings::update(JsonObject & root, WebSettings & settings) {
65-
// set or load board profile
66-
settings.board_profile = root["board_profile"] | EMSESP_DEFAULT_BOARD_PROFILE;
67-
6865
// load default GPIO configuration based on board profile
6966
std::vector<uint8_t> data; // led, dallas, rx, tx, button
67+
settings.board_profile = root["board_profile"] | EMSESP_DEFAULT_BOARD_PROFILE;
7068
if (!System::load_board_profile(data, settings.board_profile.c_str())) {
71-
// invalid board configuration, override the default in case it has been misspelled
72-
if (!settings.board_profile.equals("CUSTOM")) {
73-
settings.board_profile = "S32";
74-
}
69+
settings.board_profile = "S32"; // invalid board configuration, override the default in case it has been misspelled
7570
}
71+
7672
uint8_t default_led_gpio = data[0];
7773
uint8_t default_dallas_gpio = data[1];
7874
uint8_t default_rx_gpio = data[2];

0 commit comments

Comments
 (0)