Refactor Settings usage

This commit is contained in:
jpirnay
2026-04-17 15:38:37 +02:00
parent f0fb6c20aa
commit 3b8b389408
10 changed files with 151 additions and 92 deletions
+2 -2
View File
@@ -33,7 +33,7 @@ namespace {
// pagesPerRefresh now comes from SETTINGS.getRefreshFrequency()
constexpr unsigned long skipChapterMs = 700;
// pages per minute, first item is 1 to prevent division by zero if accessed
const std::vector<int> PAGE_TURN_LABELS = {1, 1, 3, 6, 12};
constexpr int PAGE_TURN_LABELS[] = {1, 1, 3, 6, 12};
void logReaderMemSnapshot(const char* stage) {
const uint32_t freeHeap = esp_get_free_heap_size();
@@ -756,7 +756,7 @@ void EpubReaderActivity::applyTextDarkness(const uint8_t textDarkness) {
}
void EpubReaderActivity::toggleAutoPageTurn(const uint8_t selectedPageTurnOption) {
if (selectedPageTurnOption == 0 || selectedPageTurnOption >= PAGE_TURN_LABELS.size()) {
if (selectedPageTurnOption == 0 || selectedPageTurnOption >= std::size(PAGE_TURN_LABELS)) {
automaticPageTurnActive = false;
return;
}