mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 23:08:11 +00:00
feat: add runtime display rotation setting for e-ink builds
Adds Settings > Display > Rotation (0°/90°/180°/270°) that persists to NodePrefs and is applied on startup. Falls back to compile-time DISPLAY_ROTATION when the field is missing from an older prefs file. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -289,7 +289,18 @@ void DataStore::loadPrefsInt(const char *filename, NodePrefs& _prefs, double& no
|
||||
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));
|
||||
if (file.available()) {
|
||||
file.read((uint8_t *)&_prefs.display_rotation, sizeof(_prefs.display_rotation));
|
||||
} else {
|
||||
#ifdef DISPLAY_ROTATION
|
||||
_prefs.display_rotation = DISPLAY_ROTATION;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
} else {
|
||||
#ifdef DISPLAY_ROTATION
|
||||
_prefs.display_rotation = DISPLAY_ROTATION;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -383,6 +394,7 @@ void DataStore::savePrefs(const NodePrefs& _prefs, double node_lat, double node_
|
||||
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.use_lemon_font, sizeof(_prefs.use_lemon_font));
|
||||
file.write((uint8_t *)&_prefs.display_rotation, sizeof(_prefs.display_rotation));
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user