diff --git a/EXRAIL2.cpp b/EXRAIL2.cpp index 09566cb..122bf4a 100644 --- a/EXRAIL2.cpp +++ b/EXRAIL2.cpp @@ -747,6 +747,10 @@ void RMFT2::loop2() { skipIf=IODevice::readAnalogue(operand)>=(int)(getOperand(1)); break; + case OPCODE_IFLOCO: // do if the loco is the active one + skipIf=loco!=operand; + break; + case OPCODE_IFNOT: // do next operand if sensor not set skipIf=readSensor(operand); break; @@ -1244,4 +1248,3 @@ void RMFT2::thrungeString(uint32_t strfar, thrunger mode, byte id) { default: break; } } - \ No newline at end of file diff --git a/EXRAIL2.h b/EXRAIL2.h index 69fd382..7acb839 100644 --- a/EXRAIL2.h +++ b/EXRAIL2.h @@ -69,6 +69,7 @@ enum OPCODE : byte {OPCODE_THROW,OPCODE_CLOSE, OPCODE_IFRANDOM,OPCODE_IFRESERVE, OPCODE_IFCLOSED,OPCODE_IFTHROWN, OPCODE_IFRE, + OPCODE_IFLOCO }; enum thrunger: byte { diff --git a/EXRAIL2MacroReset.h b/EXRAIL2MacroReset.h index a5e6d90..e59d1c9 100644 --- a/EXRAIL2MacroReset.h +++ b/EXRAIL2MacroReset.h @@ -65,6 +65,7 @@ #undef IFCLOSED #undef IFGREEN #undef IFGTE +#undef IFLOCO #undef IFLT #undef IFNOT #undef IFRANDOM @@ -182,6 +183,7 @@ #define IFCLOSED(turnout_id) #define IFGREEN(signal_id) #define IFGTE(sensor_id,value) +#define IFLOCO(loco_id) #define IFLT(sensor_id,value) #define IFNOT(sensor_id) #define IFRANDOM(percent)