From ca380d11dcaf01459614d2527577a08eb00cb43b Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Wed, 10 Jan 2024 08:15:30 +0100 Subject: [PATCH 1/5] Do not crash on turnouts or turntables without description --- EXRAIL2.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/EXRAIL2.cpp b/EXRAIL2.cpp index cc3269b..8a2eadf 100644 --- a/EXRAIL2.cpp +++ b/EXRAIL2.cpp @@ -333,13 +333,15 @@ if (compileFeatures & FEATURE_SIGNAL) { } void RMFT2::setTurnoutHiddenState(Turnout * t) { - // turnout descriptions are in low flash F strings - t->setHidden(GETFLASH(getTurnoutDescription(t->getId()))==0x01); + // turnout descriptions are in low flash F strings + const FSH *desc = getTurnoutDescription(t->getId()); + if (desc) t->setHidden(GETFLASH(desc)==0x01); } #ifndef IO_NO_HAL void RMFT2::setTurntableHiddenState(Turntable * tto) { - tto->setHidden(GETFLASH(getTurntableDescription(tto->getId()))==0x01); + const FSH *desc = getTurntableDescription(tto->getId()); + if (desc) tto->setHidden(GETFLASH(desc)==0x01); } #endif From 27bd4448845e82b8d5d614dcc2d412bbde975c1c Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Wed, 10 Jan 2024 08:18:14 +0100 Subject: [PATCH 2/5] Numbers for automations/routes can be negative --- EXRAIL2Parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EXRAIL2Parser.cpp b/EXRAIL2Parser.cpp index b049699..d231342 100644 --- a/EXRAIL2Parser.cpp +++ b/EXRAIL2Parser.cpp @@ -134,7 +134,7 @@ void RMFT2::ComandFilter(Print * stream, byte & opcode, byte & paramCount, int16 return; } if (paramCount==2) { // - uint16_t id=p[1]; + int16_t id=p[1]; StringFormatter::send(stream,F("\n"), id, getRouteType(id), getRouteDescription(id)); From 796d5c47748a4c189f2b04c1e3215f6f54a2c9b2 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Wed, 10 Jan 2024 08:20:14 +0100 Subject: [PATCH 3/5] version 5.2.22 --- GITHUB_SHA.h | 2 +- version.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/GITHUB_SHA.h b/GITHUB_SHA.h index 1cc285a..a53b57a 100644 --- a/GITHUB_SHA.h +++ b/GITHUB_SHA.h @@ -1 +1 @@ -#define GITHUB_SHA "devel-202401081219Z" +#define GITHUB_SHA "devel-202401100719Z" diff --git a/version.h b/version.h index 9f19afe..3c33933 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,8 @@ #include "StringFormatter.h" -#define VERSION "5.2.21" +#define VERSION "5.2.22" +// 5.2.22 - Bugfixes: Empty turnout descriptions ok; negative route numbers valid. // 5.2.21 - Add STARTUP_DELAY config option to delay CS bootup // 5.2.20 - Check return of Ethernet.begin() // 5.2.19 - ESP32: Determine if the RMT hardware can handle DCC From 8e56a1e7f9c8940b77bde293290dd3327776c718 Mon Sep 17 00:00:00 2001 From: Ash-4 <81280775+Ash-4@users.noreply.github.com> Date: Wed, 10 Jan 2024 01:34:29 -0600 Subject: [PATCH 4/5] Update version.h --- version.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/version.h b/version.h index ee50594..bb100bb 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,8 @@ #include "StringFormatter.h" -#define VERSION "5.2.21ethCdf" +#define VERSION "5.2.22" +// 5.2.22 - Bugfixes: Empty turnout descriptions ok; negative route numbers valid. // 5.2.21 - Add STARTUP_DELAY config option to delay CS bootup // 5.2.20 - Check return of Ethernet.begin() // 5.2.19 - ESP32: Determine if the RMT hardware can handle DCC From 1bd113a35f87701b7e5a097661ec9b3c1b123591 Mon Sep 17 00:00:00 2001 From: Ash-4 <81280775+Ash-4@users.noreply.github.com> Date: Wed, 10 Jan 2024 01:40:31 -0600 Subject: [PATCH 5/5] update for negative routes 5.2.22 --- version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.h b/version.h index bb100bb..909d56b 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,7 @@ #include "StringFormatter.h" -#define VERSION "5.2.22" +#define VERSION "5.2.22ethCdf" // 5.2.22 - Bugfixes: Empty turnout descriptions ok; negative route numbers valid. // 5.2.21 - Add STARTUP_DELAY config option to delay CS bootup // 5.2.20 - Check return of Ethernet.begin()