From 88b572a14838389fff1b07e6e9e43f3ab84093c3 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Thu, 26 Jan 2023 16:55:58 +0100 Subject: [PATCH] Add EXRAIL IFLOCO function --- EXRAIL2.cpp | 5 ++++- EXRAIL2.h | 1 + EXRAIL2MacroReset.h | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) 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)