diff --git a/EXRAIL2.cpp b/EXRAIL2.cpp index 9b11cfc..20b205d 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 { @@ -921,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; 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/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")); } diff --git a/version.h b/version.h index cbbb391..fb87570 100644 --- a/version.h +++ b/version.h @@ -3,8 +3,9 @@ #include "StringFormatter.h" -#define VERSION "5.2.75i2c" -// 5.2.75i2c - Add various I2C drivers, including TCA8418 and Adafruit NeoPixel Driver initially +#define VERSION "5.2.76i2c" +// 5.2.76i2c - Add various I2C drivers, including TCA8418 and Adafruit NeoPixel Driver initially +// 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