mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-26 08:39:09 +03:00
clear_snapshot_gpios
This commit is contained in:
@@ -2819,6 +2819,14 @@ void System::restore_snapshot_gpios() {
|
|||||||
for (const auto & gpio : snapshot_valid_system_gpios_) {
|
for (const auto & gpio : snapshot_valid_system_gpios_) {
|
||||||
valid_system_gpios_.push_back(gpio);
|
valid_system_gpios_.push_back(gpio);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clear the snapshot
|
||||||
|
clear_snapshot_gpios();
|
||||||
|
}
|
||||||
|
|
||||||
|
void System::clear_snapshot_gpios() {
|
||||||
|
snapshot_used_gpios_.clear();
|
||||||
|
snapshot_valid_system_gpios_.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace emsesp
|
} // namespace emsesp
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ class System {
|
|||||||
static bool load_board_profile(std::vector<int8_t> & data, const std::string & board_profile);
|
static bool load_board_profile(std::vector<int8_t> & data, const std::string & board_profile);
|
||||||
static void make_snapshot_gpios();
|
static void make_snapshot_gpios();
|
||||||
static void restore_snapshot_gpios();
|
static void restore_snapshot_gpios();
|
||||||
|
static void clear_snapshot_gpios();
|
||||||
|
|
||||||
static bool readCommand(const char * data);
|
static bool readCommand(const char * data);
|
||||||
|
|
||||||
|
|||||||
@@ -322,6 +322,8 @@ StateUpdateResult WebSettings::update(JsonObject root, WebSettings & settings) {
|
|||||||
return StateUpdateResult::ERROR; // don't save the settings if the GPIOs are invalid
|
return StateUpdateResult::ERROR; // don't save the settings if the GPIOs are invalid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clean up snapshot of the GPIOs
|
||||||
|
EMSESP::system_.clear_snapshot_gpios();
|
||||||
|
|
||||||
// save the setting internally, for reference later
|
// save the setting internally, for reference later
|
||||||
EMSESP::system_.store_settings(settings);
|
EMSESP::system_.store_settings(settings);
|
||||||
|
|||||||
Reference in New Issue
Block a user