diff --git a/examples/companion_radio/DataStore.cpp b/examples/companion_radio/DataStore.cpp index e3e8657c..d9e0d10c 100644 --- a/examples/companion_radio/DataStore.cpp +++ b/examples/companion_radio/DataStore.cpp @@ -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(); }