diff --git a/EXRAIL2.cpp b/EXRAIL2.cpp index cda9c9d..0e17ea9 100644 --- a/EXRAIL2.cpp +++ b/EXRAIL2.cpp @@ -266,12 +266,12 @@ void RMFT2::setTurnoutHiddenState(Turnout * t) { char RMFT2::getRouteType(int16_t id) { for (int16_t i=0;;i+=2) { int16_t rid= GETHIGHFLASHW(routeIdList,i); - if (rid==0) break; + if (rid==INT16_MAX) break; if (rid==id) return 'R'; } for (int16_t i=0;;i+=2) { int16_t rid= GETHIGHFLASHW(automationIdList,i); - if (rid==0) break; + if (rid==INT16_MAX) break; if (rid==id) return 'A'; } return 'X'; diff --git a/EXRAILMacros.h b/EXRAILMacros.h index 6a4ad4f..f48ca6f 100644 --- a/EXRAILMacros.h +++ b/EXRAILMacros.h @@ -190,7 +190,7 @@ const FSH * RMFT2::getTurnoutDescription(int16_t turnoutid) { // Pass 6: Roster IDs (count) #include "EXRAIL2MacroReset.h" #undef ROSTER -#define ROSTER(cabid,name,funcmap...) +(cabid == 0 ? 0 : 1) +#define ROSTER(cabid,name,funcmap...) +(cabid <= 0 ? 0 : 1) const byte RMFT2::rosterNameCount=0 #include "myAutomation.h" ; diff --git a/GITHUB_SHA.h b/GITHUB_SHA.h index 01f7c20..dec43d1 100644 --- a/GITHUB_SHA.h +++ b/GITHUB_SHA.h @@ -1 +1 @@ -#define GITHUB_SHA "devel-202305222043Z" +#define GITHUB_SHA "devel-202305231659Z" diff --git a/WiThrottle.cpp b/WiThrottle.cpp index 11a28fb..974d850 100644 --- a/WiThrottle.cpp +++ b/WiThrottle.cpp @@ -531,11 +531,13 @@ void WiThrottle::sendRoster(Print* stream) { rosterSent=true; #ifdef EXRAIL_ACTIVE StringFormatter::send(stream,F("RL%d"), RMFT2::rosterNameCount); - for (int16_t r=0;r 0) StringFormatter::send(stream,F("]\\[%S}|{%d}|{%c"), RMFT2::getRosterName(cabid),cabid,cabid<128?'S':'L'); + else if (cabid == INT16_MAX) + break; } StringFormatter::send(stream,F("\n")); #else