From c07ac38ab11240fe7d0d8d894d568008599e3b1e Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Wed, 4 Sep 2024 09:11:51 +0200 Subject: [PATCH 1/4] EXRAIL: Catch CV read errors in the callback --- EXRAIL2.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/EXRAIL2.cpp b/EXRAIL2.cpp index 1a7f888..bfa011d 100644 --- a/EXRAIL2.cpp +++ b/EXRAIL2.cpp @@ -478,10 +478,15 @@ bool RMFT2::skipIfBlock() { /* static */ void RMFT2::readLocoCallback(int16_t cv) { + if (cv <= 0) { + DIAG(F("CV read error")); + progtrackLocoId = -1; + return; + } if (cv & LONG_ADDR_MARKER) { // maker bit indicates long addr progtrackLocoId = cv ^ LONG_ADDR_MARKER; // remove marker bit to get real long addr if (progtrackLocoId <= HIGHEST_SHORT_ADDR ) { // out of range for long addr - DIAG(F("Long addr %d <= %d unsupported\n"), progtrackLocoId, HIGHEST_SHORT_ADDR); + DIAG(F("Long addr %d <= %d unsupported"), progtrackLocoId, HIGHEST_SHORT_ADDR); progtrackLocoId = -1; } } else { From 6fa55116702db71b8045d44887767f3308c09521 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Wed, 4 Sep 2024 09:13:52 +0200 Subject: [PATCH 2/4] version --- 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 959a003..839dbb0 100644 --- a/GITHUB_SHA.h +++ b/GITHUB_SHA.h @@ -1 +1 @@ -#define GITHUB_SHA "devel-202408291145Z" +#define GITHUB_SHA "devel-202409040713Z" diff --git a/version.h b/version.h index bf08399..2220087 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,8 @@ #include "StringFormatter.h" -#define VERSION "5.2.75" +#define VERSION "5.2.76" +// 5.2.76 - Bugfix: EXRAIL: Catch CV read errors in the callback // 5.2.75 - Bugfix: Serial lines 4 to 6 OK // 5.2.74 - Bugfix: ESP32 turn on the joined prog (as main) again after a prog operation // 5.2.73 - Bugfix: STM32 further fixes to shadowPORT entries in TrackManager.cpp for PORTG and PORTH From 7ffbd9d0e856f08619db9aa5c7a4cbff100d6758 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Thu, 5 Sep 2024 13:01:54 +0200 Subject: [PATCH 3/4] Use port variable --- WifiESP32.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WifiESP32.cpp b/WifiESP32.cpp index 83dd2e1..d44672a 100644 --- a/WifiESP32.cpp +++ b/WifiESP32.cpp @@ -265,7 +265,7 @@ bool WifiESP::setup(const char *SSid, if(!MDNS.begin(hostname)) { DIAG(F("Wifi setup failed to start mDNS")); } - if(!MDNS.addService("withrottle", "tcp", 2560)) { + if(!MDNS.addService("withrottle", "tcp", port)) { DIAG(F("Wifi setup failed to add withrottle service to mDNS")); } From b026417efb6e927deee9ac8b492c07865afee9a7 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Fri, 6 Sep 2024 09:28:40 +0200 Subject: [PATCH 4/4] EXTRAIL: Propagate a failed loco addr read to EXRAIL so it can be used as IFLOCO(-1) --- EXRAIL2.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/EXRAIL2.cpp b/EXRAIL2.cpp index bfa011d..f228f1f 100644 --- a/EXRAIL2.cpp +++ b/EXRAIL2.cpp @@ -926,11 +926,10 @@ void RMFT2::loop2() { delayMe(100); return; // still waiting for callback } - if (progtrackLocoId<0) { - kill(F("No Loco Found"),progtrackLocoId); - return; // still waiting for callback - } + // At failed read will result in loco == -1 + // which is intended so it can be checked + // from within EXRAIL loco=progtrackLocoId; speedo=0; forward=true;