mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-07-28 09:53:45 +02:00
Squashed commit of the following:
commit8987d622e6
Author: Asbelos <asbelos@btinternet.com> Date: Tue Apr 9 20:44:47 2024 +0100 doc note commit8f0a5c1ec0
Author: Asbelos <asbelos@btinternet.com> Date: Thu Apr 4 09:45:58 2024 +0100 Exrail notes commit94083b9ab8
Merge:72ef199
02bf50b
Author: Asbelos <asbelos@btinternet.com> Date: Thu Apr 4 09:08:26 2024 +0100 Merge branch 'devel' into devel_chris commit72ef199315
Author: Asbelos <asbelos@btinternet.com> Date: Thu Apr 4 09:06:50 2024 +0100 TOGGLE_TURNOUT commite69b777a2f
Author: Asbelos <asbelos@btinternet.com> Date: Wed Apr 3 15:17:40 2024 +0100 BLINK command commitc7ed47400d
Author: Asbelos <asbelos@btinternet.com> Date: Tue Apr 2 10:12:45 2024 +0100 FTOGGLE,XFTOGGLE commit7a93cf7be8
Author: Asbelos <asbelos@btinternet.com> Date: Fri Mar 29 13:21:35 2024 +0000 EXRAIL STEALTH_GLOBAL
This commit is contained in:
18
EXRAIL2.h
18
EXRAIL2.h
@@ -33,7 +33,7 @@
|
||||
// or more OPCODE_PAD instructions with the subsequent parameters. This wastes a byte but makes
|
||||
// searching easier as a parameter can never be confused with an opcode.
|
||||
//
|
||||
enum OPCODE : byte {OPCODE_THROW,OPCODE_CLOSE,
|
||||
enum OPCODE : byte {OPCODE_THROW,OPCODE_CLOSE,OPCODE_TOGGLE_TURNOUT,
|
||||
OPCODE_FWD,OPCODE_REV,OPCODE_SPEED,OPCODE_INVERT_DIRECTION,
|
||||
OPCODE_RESERVE,OPCODE_FREE,
|
||||
OPCODE_AT,OPCODE_AFTER,
|
||||
@@ -41,9 +41,11 @@ enum OPCODE : byte {OPCODE_THROW,OPCODE_CLOSE,
|
||||
OPCODE_ATGTE,OPCODE_ATLT,
|
||||
OPCODE_ATTIMEOUT1,OPCODE_ATTIMEOUT2,
|
||||
OPCODE_LATCH,OPCODE_UNLATCH,OPCODE_SET,OPCODE_RESET,
|
||||
OPCODE_BLINK,
|
||||
OPCODE_ENDIF,OPCODE_ELSE,
|
||||
OPCODE_DELAY,OPCODE_DELAYMINS,OPCODE_DELAYMS,OPCODE_RANDWAIT,
|
||||
OPCODE_FON,OPCODE_FOFF,OPCODE_XFON,OPCODE_XFOFF,
|
||||
OPCODE_FTOGGLE,OPCODE_XFTOGGLE,
|
||||
OPCODE_RED,OPCODE_GREEN,OPCODE_AMBER,OPCODE_DRIVE,
|
||||
OPCODE_SERVO,OPCODE_SIGNAL,OPCODE_TURNOUT,OPCODE_WAITFOR,
|
||||
OPCODE_PAD,OPCODE_FOLLOW,OPCODE_CALL,OPCODE_RETURN,
|
||||
@@ -98,12 +100,21 @@ enum thrunger: byte {
|
||||
thrunge_lcd, // Must be last!!
|
||||
};
|
||||
|
||||
|
||||
enum BlinkState: byte {
|
||||
not_blink_task,
|
||||
blink_low, // blink task running with pin LOW
|
||||
blink_high, // blink task running with pin high
|
||||
at_timeout // ATTIMEOUT timed out flag
|
||||
};
|
||||
|
||||
// Flag bits for compile time features.
|
||||
static const byte FEATURE_SIGNAL= 0x80;
|
||||
static const byte FEATURE_LCC = 0x40;
|
||||
static const byte FEATURE_ROSTER= 0x20;
|
||||
static const byte FEATURE_ROUTESTATE= 0x10;
|
||||
static const byte FEATURE_STASH = 0x08;
|
||||
static const byte FEATURE_BLINK = 0x04;
|
||||
|
||||
|
||||
// Flag bits for status of hardware and TPL
|
||||
@@ -192,6 +203,7 @@ private:
|
||||
static LookList* LookListLoader(OPCODE op1,
|
||||
OPCODE op2=OPCODE_ENDEXRAIL,OPCODE op3=OPCODE_ENDEXRAIL);
|
||||
static uint16_t getOperand(int progCounter,byte n);
|
||||
static void killBlinkOnVpin(VPIN pin);
|
||||
static RMFT2 * loopTask;
|
||||
static RMFT2 * pausingTask;
|
||||
void delayMe(long millisecs);
|
||||
@@ -244,10 +256,10 @@ private:
|
||||
union {
|
||||
unsigned long waitAfter; // Used by OPCODE_AFTER
|
||||
unsigned long timeoutStart; // Used by OPCODE_ATTIMEOUT
|
||||
VPIN blinkPin; // Used by blink tasks
|
||||
};
|
||||
bool timeoutFlag;
|
||||
byte taskId;
|
||||
|
||||
BlinkState blinkState; // includes AT_TIMEOUT flag.
|
||||
uint16_t loco;
|
||||
bool forward;
|
||||
bool invert;
|
||||
|
Reference in New Issue
Block a user