From a11e275ce15d0524fcd55a2c5a042266b4fc4370 Mon Sep 17 00:00:00 2001 From: Djuri Baars Date: Mon, 13 Nov 2023 17:17:28 +0100 Subject: [PATCH] Fix screen rotation --- src/lib/screen_handler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/screen_handler.cpp b/src/lib/screen_handler.cpp index 7c337ad..80bc221 100644 --- a/src/lib/screen_handler.cpp +++ b/src/lib/screen_handler.cpp @@ -216,12 +216,12 @@ void taskScreenRotate(void *pvParameters) { ulTaskNotifyTake(pdTRUE, portMAX_DELAY); - int nextScreen = (currentScreen + 1) % 5; + int nextScreen = (currentScreen + 1) % SCREEN_COUNT; String key = "screen" + String(nextScreen) + "Visible"; while (!preferences.getBool(key.c_str(), true)) { - nextScreen = (nextScreen + 1) % 5; + nextScreen = (nextScreen + 1) % SCREEN_COUNT; key = "screen" + String(nextScreen) + "Visible"; }