From e7eff7ef5663a5cd7621dd700c42b4fddfc266b6 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Mon, 25 Nov 2024 12:33:44 +0000 Subject: [PATCH] XPOM --- EXRAIL2.cpp | 4 ++++ EXRAIL2.h | 2 +- EXRAIL2MacroReset.h | 2 ++ EXRAILMacros.h | 1 + Release_Notes/Railcom.md | 6 +++++- 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/EXRAIL2.cpp b/EXRAIL2.cpp index cdbf398..94e43f6 100644 --- a/EXRAIL2.cpp +++ b/EXRAIL2.cpp @@ -714,6 +714,10 @@ void RMFT2::loop2() { if (loco) DCC::writeCVByteMain(loco, operand, getOperand(1)); break; + case OPCODE_XPOM: + DCC::writeCVByteMain(operand, getOperand(1), getOperand(2)); + break; + case OPCODE_POWEROFF: TrackManager::setPower(POWERMODE::OFF); TrackManager::setJoin(false); diff --git a/EXRAIL2.h b/EXRAIL2.h index fe1c90e..6165cab 100644 --- a/EXRAIL2.h +++ b/EXRAIL2.h @@ -78,7 +78,7 @@ enum OPCODE : byte {OPCODE_THROW,OPCODE_CLOSE,OPCODE_TOGGLE_TURNOUT, OPCODE_ONBUTTON,OPCODE_ONSENSOR, OPCODE_NEOPIXEL, OPCODE_ONBLOCKENTER,OPCODE_ONBLOCKEXIT, - OPCODE_ESTOPALL, + OPCODE_ESTOPALL,OPCODE_XPOM, // OPcodes below this point are skip-nesting IF operations // placed here so that they may be skipped as a group // see skipIfBlock() diff --git a/EXRAIL2MacroReset.h b/EXRAIL2MacroReset.h index c6352e0..ccb39be 100644 --- a/EXRAIL2MacroReset.h +++ b/EXRAIL2MacroReset.h @@ -197,6 +197,7 @@ #undef XFOFF #undef XFON #undef XFTOGGLE +#undef XPOM #ifndef RMFT2_UNDEF_ONLY #define ACTIVATE(addr,subaddr) @@ -371,5 +372,6 @@ #define XFOFF(cab,func) #define XFON(cab,func) #define XFTOGGLE(cab,func) +#define XPOM(cab,cv,value) #endif diff --git a/EXRAILMacros.h b/EXRAILMacros.h index 74725f3..47b0174 100644 --- a/EXRAILMacros.h +++ b/EXRAILMacros.h @@ -672,6 +672,7 @@ int RMFT2::onLCCLookup[RMFT2::countLCCLookup]; #define XFOFF(cab,func) OPCODE_XFOFF,V(cab),OPCODE_PAD,V(func), #define XFON(cab,func) OPCODE_XFON,V(cab),OPCODE_PAD,V(func), #define XFTOGGLE(cab,func) OPCODE_XFTOGGLE,V(cab),OPCODE_PAD,V(func), +#define XPOM(cab,cv,value) OPCODE_XPOM,V(cab),OPCODE_PAD,V(cv),OPCODE_PAD,V(value), // Build RouteCode const int StringMacroTracker2=__COUNTER__; diff --git a/Release_Notes/Railcom.md b/Release_Notes/Railcom.md index dd34036..1aef21f 100644 --- a/Release_Notes/Railcom.md +++ b/Release_Notes/Railcom.md @@ -68,4 +68,8 @@ Making use of Railcom data response is `` - +Additional EXRAIL features in Railcom Branch: + - ESTAOPALL stops all locos immediately + - XPOM(cab,cv,value) POM write cv to sepcific loco + (POM(cv,value) already writes cv to current loco) + \ No newline at end of file