From 4eaad2d05bf15e670f67413ec9c5fbc765d687a9 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Sun, 23 Apr 2023 22:45:47 +0200 Subject: [PATCH] disable more PROG stuff (JOIN/UNJOIN from EXRAIL) --- DCCEXParser.cpp | 14 +++++++------- EXRAIL2.cpp | 20 ++++++++++---------- EXRAIL2.h | 4 ++-- GITHUB_SHA.h | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index 0a496d5..fb9c24d 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -3,7 +3,7 @@ * © 2021 Neil McKechnie * © 2021 Mike S * © 2021 Herb Morton - * © 2020-2022 Harald Barth + * © 2020-2023 Harald Barth * © 2020-2021 M Steve Todd * © 2020-2021 Fred Decker * © 2020-2021 Chris Harlow @@ -55,7 +55,6 @@ // These keywords are used in the <1> command. The number is what you get if you use the keyword as a parameter. // To discover new keyword numbers , use the <$ YOURKEYWORD> command const int16_t HASH_KEYWORD_MAIN = 11339; -const int16_t HASH_KEYWORD_JOIN = -30750; const int16_t HASH_KEYWORD_CABS = -11981; const int16_t HASH_KEYWORD_RAM = 25982; const int16_t HASH_KEYWORD_CMD = 9962; @@ -64,6 +63,7 @@ const int16_t HASH_KEYWORD_ON = 2657; const int16_t HASH_KEYWORD_DCC = 6436; const int16_t HASH_KEYWORD_SLOW = -17209; #ifndef DISABLE_PROG +const int16_t HASH_KEYWORD_JOIN = -30750; const int16_t HASH_KEYWORD_PROG = -29718; const int16_t HASH_KEYWORD_PROGBOOST = -6353; #endif @@ -470,15 +470,15 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream) prog=true; } if (params==1) { - if (p[0] == HASH_KEYWORD_JOIN) { // <1 JOIN> + if (p[0]==HASH_KEYWORD_MAIN) { // <1 MAIN> + main=true; + } +#ifndef DISABLE_PROG + else if (p[0] == HASH_KEYWORD_JOIN) { // <1 JOIN> main=true; prog=true; join=true; } - else if (p[0]==HASH_KEYWORD_MAIN) { // <1 MAIN> - main=true; - } -#ifndef DISABLE_PROG else if (p[0]==HASH_KEYWORD_PROG) { // <1 PROG> prog=true; } diff --git a/EXRAIL2.cpp b/EXRAIL2.cpp index d273b9c..62b3418 100644 --- a/EXRAIL2.cpp +++ b/EXRAIL2.cpp @@ -705,11 +705,9 @@ void RMFT2::loop2() { pausingTask=this; break; -#ifndef DISABLE_PROG case OPCODE_POM: if (loco) DCC::writeCVByteMain(loco, operand, getOperand(1)); break; -#endif case OPCODE_POWEROFF: TrackManager::setPower(POWERMODE::OFF); @@ -885,23 +883,18 @@ void RMFT2::loop2() { while(loopTask) loopTask->kill(F("KILLALL")); return; +#ifndef DISABLE_PROG case OPCODE_JOIN: TrackManager::setPower(POWERMODE::ON); TrackManager::setJoin(true); CommandDistributor::broadcastPower(); break; - - case OPCODE_POWERON: - TrackManager::setMainPower(POWERMODE::ON); - TrackManager::setJoin(false); - CommandDistributor::broadcastPower(); - break; - + case OPCODE_UNJOIN: TrackManager::setJoin(false); CommandDistributor::broadcastPower(); break; - + case OPCODE_READ_LOCO1: // READ_LOCO is implemented as 2 separate opcodes progtrackLocoId=LOCO_ID_WAITING; // Nothing found yet DCC::getLocoId(readLocoCallback); @@ -922,6 +915,13 @@ void RMFT2::loop2() { forward=true; invert=false; break; +#endif + + case OPCODE_POWERON: + TrackManager::setMainPower(POWERMODE::ON); + TrackManager::setJoin(false); + CommandDistributor::broadcastPower(); + break; case OPCODE_START: { diff --git a/EXRAIL2.h b/EXRAIL2.h index 785267a..99b0808 100644 --- a/EXRAIL2.h +++ b/EXRAIL2.h @@ -45,10 +45,10 @@ enum OPCODE : byte {OPCODE_THROW,OPCODE_CLOSE, OPCODE_RED,OPCODE_GREEN,OPCODE_AMBER,OPCODE_DRIVE, OPCODE_SERVO,OPCODE_SIGNAL,OPCODE_TURNOUT,OPCODE_WAITFOR, OPCODE_PAD,OPCODE_FOLLOW,OPCODE_CALL,OPCODE_RETURN, - OPCODE_JOIN,OPCODE_UNJOIN,OPCODE_READ_LOCO1,OPCODE_READ_LOCO2, #ifndef DISABLE_PROG - OPCODE_POM, + OPCODE_JOIN,OPCODE_UNJOIN,OPCODE_READ_LOCO1,OPCODE_READ_LOCO2, #endif + OPCODE_POM, OPCODE_START,OPCODE_SETLOCO,OPCODE_SENDLOCO,OPCODE_FORGET, OPCODE_PAUSE, OPCODE_RESUME,OPCODE_POWEROFF,OPCODE_POWERON, OPCODE_ONCLOSE, OPCODE_ONTHROW, OPCODE_SERVOTURNOUT, OPCODE_PINTURNOUT, diff --git a/GITHUB_SHA.h b/GITHUB_SHA.h index b530ccd..f889b98 100644 --- a/GITHUB_SHA.h +++ b/GITHUB_SHA.h @@ -1 +1 @@ -#define GITHUB_SHA "devel-202304231822Z" +#define GITHUB_SHA "devel-202304232045Z"