From 27ba55198679610b37cd2c2542fc5d3ab6f21b85 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Tue, 14 Mar 2023 20:50:24 +0100 Subject: [PATCH] Bugfix LCD showed random characters in SCROLLMODE 2 --- Display.cpp | 15 +++++++++------ GITHUB_SHA.h | 2 +- version.h | 3 ++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Display.cpp b/Display.cpp index 2c44778..a1a1ec1 100644 --- a/Display.cpp +++ b/Display.cpp @@ -1,5 +1,6 @@ /* * © 2021, Chris Harlow, Neil McKechnie. All rights reserved. + * © 2023, Harald Barth. * * This file is part of CommandStation-EX * @@ -52,7 +53,7 @@ Display::Display(DisplayDevice *deviceDriver) { _deviceDriver = deviceDriver; // Get device dimensions in characters (e.g. 16x2). numCharacterColumns = _deviceDriver->getNumCols(); - numCharacterRows = _deviceDriver->getNumRows();; + numCharacterRows = _deviceDriver->getNumRows(); for (uint8_t row = 0; row < MAX_CHARACTER_ROWS; row++) rowBuffer[row][0] = '\0'; topRow = ROW_INITIAL; // loop2 will fill from row 0 @@ -173,16 +174,18 @@ bool Display::findNextNonBlankRow() { rowNext = 0; else rowNext = rowNext + 1; - if (rowNext >= MAX_CHARACTER_ROWS) rowNext = ROW_INITIAL; #if SCROLLMODE == 1 - // Finished if we've looped back to start - if (rowNext == ROW_INITIAL) { + if (rowNext >= MAX_CHARACTER_ROWS) { + // Finished if we've looped back to start + rowNext = ROW_INITIAL; noMoreRowsToDisplay = true; return false; } #else - // Finished if we're back to the first one shown + if (rowNext >= MAX_CHARACTER_ROWS) + rowNext = 0; if (rowNext == rowFirst) { + // Finished if we're back to the first one shown noMoreRowsToDisplay = true; return false; } @@ -193,4 +196,4 @@ bool Display::findNextNonBlankRow() { } } return false; -} \ No newline at end of file +} diff --git a/GITHUB_SHA.h b/GITHUB_SHA.h index db56eac..be808f8 100644 --- a/GITHUB_SHA.h +++ b/GITHUB_SHA.h @@ -1 +1 @@ -#define GITHUB_SHA "devel-202303101548Z" +#define GITHUB_SHA "devel-202303141949Z" diff --git a/version.h b/version.h index 21f8e5e..b8f547f 100644 --- a/version.h +++ b/version.h @@ -4,7 +4,8 @@ #include "StringFormatter.h" -#define VERSION "4.2.26" +#define VERSION "4.2.27" +// 4.2.27 - Bugfix LCD showed random characters in SCROLLMODE 2 // 4.2.26 - EX-IOExpander device driver enhancements // - Enhance I2C error checking // - Introduce delays to _loop to allow room for other I2C device comms