From 721010c42ab08034786177f8eb5d757c8a0c414b Mon Sep 17 00:00:00 2001 From: "Igor K. Dulevich" Date: Fri, 6 Sep 2024 23:35:27 +0300 Subject: [PATCH] First upload fix and clockfaces new line char fix (#84) --- EleksTubeHAX_pio/src/TFTs.cpp | 1 + EleksTubeHAX_pio/src/main.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/EleksTubeHAX_pio/src/TFTs.cpp b/EleksTubeHAX_pio/src/TFTs.cpp index d8a2a87..17f1874 100644 --- a/EleksTubeHAX_pio/src/TFTs.cpp +++ b/EleksTubeHAX_pio/src/TFTs.cpp @@ -57,6 +57,7 @@ void TFTs::loadClockFacesNames() { } while(f.available() && i<9) { patterns_str[i] = f.readStringUntil('\n'); + patterns_str[i].replace(String(char(13)), ""); Serial.println(patterns_str[i]); i++; } diff --git a/EleksTubeHAX_pio/src/main.cpp b/EleksTubeHAX_pio/src/main.cpp index d942c1e..00ab517 100644 --- a/EleksTubeHAX_pio/src/main.cpp +++ b/EleksTubeHAX_pio/src/main.cpp @@ -127,6 +127,10 @@ void setup() { uclock.setActiveGraphicIdx(tfts.NumberOfClockFaces); Serial.println("Last selected index of clock face is larger than currently available number of image sets."); } + if (uclock.getActiveGraphicIdx() < 1) { + uclock.setActiveGraphicIdx(1); + Serial.println("Last selected index of clock face is less than 1."); + } tfts.current_graphic = uclock.getActiveGraphicIdx(); tfts.println("Done with setup.");