mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 23:08:11 +00:00
fix: persist auto_lock setting across reboots
auto_lock was defined in NodePrefs but missing from both loadPrefsInt and savePrefs in DataStore.cpp. Added at the end of the serialization chain (inside if(file.available())) for backwards compatibility with existing saved files — old files default to auto_lock=0 (disabled). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -283,6 +283,9 @@ void DataStore::loadPrefsInt(const char *filename, NodePrefs& _prefs, double& no
|
||||
file.read((uint8_t *)&_prefs.ch_notif_melody_2, sizeof(_prefs.ch_notif_melody_2));
|
||||
if (file.available()) {
|
||||
file.read((uint8_t *)_prefs.dm_melody, sizeof(_prefs.dm_melody));
|
||||
if (file.available()) {
|
||||
file.read((uint8_t *)&_prefs.auto_lock, sizeof(_prefs.auto_lock));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -371,6 +374,7 @@ void DataStore::savePrefs(const NodePrefs& _prefs, double node_lat, double node_
|
||||
file.write((uint8_t *)&_prefs.ch_notif_melody_set, sizeof(_prefs.ch_notif_melody_set));
|
||||
file.write((uint8_t *)&_prefs.ch_notif_melody_2, sizeof(_prefs.ch_notif_melody_2));
|
||||
file.write((uint8_t *)_prefs.dm_melody, sizeof(_prefs.dm_melody));
|
||||
file.write((uint8_t *)&_prefs.auto_lock, sizeof(_prefs.auto_lock));
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user