diff --git a/EXRAIL2.cpp b/EXRAIL2.cpp index 6ca4e89..cdbf398 100644 --- a/EXRAIL2.cpp +++ b/EXRAIL2.cpp @@ -585,6 +585,10 @@ void RMFT2::loop2() { case OPCODE_SPEED: if (loco) DCC::setThrottle(loco,operand,DCC::getThrottleDirection(loco)); break; + + case OPCODE_ESTOPALL: + DCC::setThrottle(0,1,1); // all locos speed=1 + break; case OPCODE_FORGET: if (loco!=0) { diff --git a/EXRAIL2.h b/EXRAIL2.h index 06eca0f..fe1c90e 100644 --- a/EXRAIL2.h +++ b/EXRAIL2.h @@ -78,6 +78,7 @@ enum OPCODE : byte {OPCODE_THROW,OPCODE_CLOSE,OPCODE_TOGGLE_TURNOUT, OPCODE_ONBUTTON,OPCODE_ONSENSOR, OPCODE_NEOPIXEL, OPCODE_ONBLOCKENTER,OPCODE_ONBLOCKEXIT, + OPCODE_ESTOPALL, // 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 f57b977..c6352e0 100644 --- a/EXRAIL2MacroReset.h +++ b/EXRAIL2MacroReset.h @@ -60,6 +60,7 @@ #undef ENDIF #undef ENDTASK #undef ESTOP +#undef ESTOPALL #undef EXRAIL #undef EXTT_TURNTABLE #undef FADE @@ -234,6 +235,7 @@ #define ENDIF #define ENDTASK #define ESTOP +#define ESTOPALL #define EXRAIL #define EXTT_TURNTABLE(id,vpin,home,description...) #define FADE(pin,value,ms) diff --git a/EXRAILMacros.h b/EXRAILMacros.h index 30f02a9..74725f3 100644 --- a/EXRAILMacros.h +++ b/EXRAILMacros.h @@ -516,6 +516,7 @@ int RMFT2::onLCCLookup[RMFT2::countLCCLookup]; #define ENDIF OPCODE_ENDIF,0,0, #define ENDTASK OPCODE_ENDTASK,0,0, #define ESTOP OPCODE_SPEED,V(1), +#define ESTOPALL OPCODE_ESTOPALL,0,0, #define EXRAIL #ifndef IO_NO_HAL #define EXTT_TURNTABLE(id,vpin,home,description...) OPCODE_EXTTTURNTABLE,V(id),OPCODE_PAD,V(vpin),OPCODE_PAD,V(home),