Save settings on change only / All builds OK (#1699) (#1704)

This commit is contained in:
Ivan Zorin
2023-06-18 07:31:05 +03:00
committed by GitHub
parent 4c5e885363
commit 4d7e4f41e3
11 changed files with 12 additions and 13 deletions

View File

@@ -105,7 +105,11 @@ static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOp
};
static_assert((sizeof(settingsConstants) / sizeof(SettingConstants)) == ((int)SettingsOptions::SettingsOptionsLength));
void saveSettings() { flash_save_buffer((uint8_t *)&systemSettings, sizeof(systemSettingsType)); }
void saveSettings() {
if (memcmp((void *)SETTINGS_START_PAGE, (void *)&systemSettings, sizeof(systemSettingsType))) {
flash_save_buffer((uint8_t *)&systemSettings, sizeof(systemSettingsType));
}
}
bool loadSettings() {
// We read the flash