Add auto-sleep timeout setting and handle it in loop

Incremented settings count, added autoSleepMinutes to CrossPointSettings, updated save/load functions, and integrated auto-sleep logic based on the new setting.
This commit is contained in:
altsysrq
2026-01-03 22:27:02 -06:00
parent 490ae79ede
commit 9ab27f848c
10 changed files with 213 additions and 54 deletions

View File

@@ -9,7 +9,7 @@
// Define the static settings list
namespace {
constexpr int settingsCount = 13;
constexpr int settingsCount = 14;
const SettingInfo settingsList[settingsCount] = {
// Should match with SLEEP_SCREEN_MODE
{"Sleep Screen", SettingType::ENUM, &CrossPointSettings::sleepScreen, {"Dark", "Light", "Custom", "Cover"}},
@@ -35,6 +35,10 @@ const SettingInfo settingsList[settingsCount] = {
{"Reader Font Size", SettingType::ENUM, &CrossPointSettings::fontSize, {"Small", "Medium", "Large", "X Large"}},
{"Reader Line Spacing", SettingType::ENUM, &CrossPointSettings::lineSpacing, {"Tight", "Normal", "Wide"}},
{"Cover Art Picker", SettingType::TOGGLE, &CrossPointSettings::useCoverArtPicker, {}},
{"Auto Sleep Timeout",
SettingType::ENUM,
&CrossPointSettings::autoSleepMinutes,
{"5 min", "10 min", "15 min", "20 min", "30 min", "60 min", "Never"}},
{"Bluetooth", SettingType::TOGGLE, &CrossPointSettings::bluetoothEnabled, {}},
{"Check for updates", SettingType::ACTION, nullptr, {}},
};