1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-27 01:56:14 +01:00

Bugfix LCD showed random characters in SCROLLMODE 2

This commit is contained in:
Harald Barth 2023-03-14 20:50:24 +01:00
parent ce12f3b6c5
commit 27ba551986
3 changed files with 12 additions and 8 deletions

View File

@ -1,5 +1,6 @@
/* /*
* © 2021, Chris Harlow, Neil McKechnie. All rights reserved. * © 2021, Chris Harlow, Neil McKechnie. All rights reserved.
* © 2023, Harald Barth.
* *
* This file is part of CommandStation-EX * This file is part of CommandStation-EX
* *
@ -52,7 +53,7 @@ Display::Display(DisplayDevice *deviceDriver) {
_deviceDriver = deviceDriver; _deviceDriver = deviceDriver;
// Get device dimensions in characters (e.g. 16x2). // Get device dimensions in characters (e.g. 16x2).
numCharacterColumns = _deviceDriver->getNumCols(); numCharacterColumns = _deviceDriver->getNumCols();
numCharacterRows = _deviceDriver->getNumRows();; numCharacterRows = _deviceDriver->getNumRows();
for (uint8_t row = 0; row < MAX_CHARACTER_ROWS; row++) for (uint8_t row = 0; row < MAX_CHARACTER_ROWS; row++)
rowBuffer[row][0] = '\0'; rowBuffer[row][0] = '\0';
topRow = ROW_INITIAL; // loop2 will fill from row 0 topRow = ROW_INITIAL; // loop2 will fill from row 0
@ -173,16 +174,18 @@ bool Display::findNextNonBlankRow() {
rowNext = 0; rowNext = 0;
else else
rowNext = rowNext + 1; rowNext = rowNext + 1;
if (rowNext >= MAX_CHARACTER_ROWS) rowNext = ROW_INITIAL;
#if SCROLLMODE == 1 #if SCROLLMODE == 1
// Finished if we've looped back to start if (rowNext >= MAX_CHARACTER_ROWS) {
if (rowNext == ROW_INITIAL) { // Finished if we've looped back to start
rowNext = ROW_INITIAL;
noMoreRowsToDisplay = true; noMoreRowsToDisplay = true;
return false; return false;
} }
#else #else
// Finished if we're back to the first one shown if (rowNext >= MAX_CHARACTER_ROWS)
rowNext = 0;
if (rowNext == rowFirst) { if (rowNext == rowFirst) {
// Finished if we're back to the first one shown
noMoreRowsToDisplay = true; noMoreRowsToDisplay = true;
return false; return false;
} }

View File

@ -1 +1 @@
#define GITHUB_SHA "devel-202303101548Z" #define GITHUB_SHA "devel-202303141949Z"

View File

@ -4,7 +4,8 @@
#include "StringFormatter.h" #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 // 4.2.26 - EX-IOExpander device driver enhancements
// - Enhance I2C error checking // - Enhance I2C error checking
// - Introduce delays to _loop to allow room for other I2C device comms // - Introduce delays to _loop to allow room for other I2C device comms