From 8bca8b1b1a806cf42c5cfd6345fd48621483bd3d Mon Sep 17 00:00:00 2001 From: Eugene Crosser Date: Wed, 24 Jul 2024 22:34:44 +0200 Subject: [PATCH] fix mac display, handle shortening of the list --- ThermoBeaconDisplay.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ThermoBeaconDisplay.cpp b/ThermoBeaconDisplay.cpp index 5297110..9c85830 100644 --- a/ThermoBeaconDisplay.cpp +++ b/ThermoBeaconDisplay.cpp @@ -109,7 +109,7 @@ void clrtop(int xpos, int yf, int yt) { } void dispaddr(char *oldv, char *newv, int xpos, int yf, int yt) { - if (strcmp(oldv, newv)) return; + if (strcmp(oldv, newv) == 0) return; tft.setViewport(xpos * (tft.width() / 2) + 10, yf + 2, (tft.width() / 2) - 20 , yt - 2); tft.fillScreen(TFT_BLACK); @@ -275,6 +275,7 @@ void updateCache(struct entry *newentry) pos++; } } + for (; pos < SLOTS; pos++) slots[pos] = NULL; // Finished modifying the list, now display for (cur = head, pos = 0; pos < SLOTS; cur = cur ? cur->next : cur, pos++) { -- 2.43.0