feat: add sleep screen selection

This commit is contained in:
dpoulter 2026-01-21 16:03:22 +02:00
parent d83fa6953c
commit a481ec1e1c

View File

@ -14,7 +14,7 @@ CrossPointSettings CrossPointSettings::instance;
namespace {
constexpr uint8_t SETTINGS_FILE_VERSION = 1;
// Increment this when adding new persisted settings fields
constexpr uint8_t SETTINGS_COUNT = 20;
constexpr uint8_t SETTINGS_COUNT = 19;
constexpr char SETTINGS_FILE[] = "/.crosspoint/settings.bin";
} // namespace
@ -111,7 +111,6 @@ bool CrossPointSettings::loadFromFile() {
strncpy(opdsServerUrl, urlStr.c_str(), sizeof(opdsServerUrl) - 1);
opdsServerUrl[sizeof(opdsServerUrl) - 1] = '\0';
}
if (++settingsRead >= fileSettingsCount) break;
serialization::readPod(inputFile, textAntiAliasing);
if (++settingsRead >= fileSettingsCount) break;
serialization::readPod(inputFile, hideBatteryPercentage);
@ -124,7 +123,6 @@ bool CrossPointSettings::loadFromFile() {
strncpy(selectedSleepBmp, bmpStr.c_str(), sizeof(selectedSleepBmp) - 1);
selectedSleepBmp[sizeof(selectedSleepBmp) - 1] = '\0';
}
++settingsRead; // Final increment (should equal fileSettingsCount for current version)
} while (false);
inputFile.close();