mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-01 09:46:22 +00:00
fix: persist use_lemon_font setting across reboots
The font preference was not saved to or loaded from flash, so it would reset to default (Adafruit font) on every boot. Added to the versioned DataStore read/write chain in the same pattern as other recently added fields (auto_lock, dm_melody etc.). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
4161951d19
commit
ca5eb221e7
@@ -287,6 +287,9 @@ void DataStore::loadPrefsInt(const char *filename, NodePrefs& _prefs, double& no
|
|||||||
file.read((uint8_t *)&_prefs.auto_lock, sizeof(_prefs.auto_lock));
|
file.read((uint8_t *)&_prefs.auto_lock, sizeof(_prefs.auto_lock));
|
||||||
if (file.available()) {
|
if (file.available()) {
|
||||||
file.read((uint8_t *)&_prefs.clock_12h, sizeof(_prefs.clock_12h));
|
file.read((uint8_t *)&_prefs.clock_12h, sizeof(_prefs.clock_12h));
|
||||||
|
if (file.available()) {
|
||||||
|
file.read((uint8_t *)&_prefs.use_lemon_font, sizeof(_prefs.use_lemon_font));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -379,6 +382,7 @@ void DataStore::savePrefs(const NodePrefs& _prefs, double node_lat, double node_
|
|||||||
file.write((uint8_t *)_prefs.dm_melody, sizeof(_prefs.dm_melody));
|
file.write((uint8_t *)_prefs.dm_melody, sizeof(_prefs.dm_melody));
|
||||||
file.write((uint8_t *)&_prefs.auto_lock, sizeof(_prefs.auto_lock));
|
file.write((uint8_t *)&_prefs.auto_lock, sizeof(_prefs.auto_lock));
|
||||||
file.write((uint8_t *)&_prefs.clock_12h, sizeof(_prefs.clock_12h));
|
file.write((uint8_t *)&_prefs.clock_12h, sizeof(_prefs.clock_12h));
|
||||||
|
file.write((uint8_t *)&_prefs.use_lemon_font, sizeof(_prefs.use_lemon_font));
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user