diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index cd929e0..12e7715 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -47,7 +47,7 @@ #define SENDFLASHLIST(stream,flashList) \ for (int16_t i=0;;i+=sizeof(flashList[0])) { \ int16_t value=GETHIGHFLASHW(flashList,i); \ - if (value<0) break; \ + if (value==INT16_MAX) break; \ StringFormatter::send(stream,F(" %d"),value); \ } diff --git a/EXRAILMacros.h b/EXRAILMacros.h index aea997d..6a4ad4f 100644 --- a/EXRAILMacros.h +++ b/EXRAILMacros.h @@ -81,14 +81,14 @@ void exrailHalSetup() { #define ROUTE(id, description) id, const int16_t HIGHFLASH RMFT2::routeIdList[]= { #include "myAutomation.h" - -1}; + INT16_MAX}; // Pass 2a create throttle automation list #include "EXRAIL2MacroReset.h" #undef AUTOMATION #define AUTOMATION(id, description) id, const int16_t HIGHFLASH RMFT2::automationIdList[]= { #include "myAutomation.h" - -1}; + INT16_MAX}; // Pass 3 Create route descriptions: #undef ROUTE @@ -201,7 +201,7 @@ const byte RMFT2::rosterNameCount=0 #define ROSTER(cabid,name,funcmap...) cabid, const int16_t HIGHFLASH RMFT2::rosterIdList[]={ #include "myAutomation.h" - -1}; + INT16_MAX}; // Pass 7: Roster names getter #include "EXRAIL2MacroReset.h"