1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-23 08:06:13 +01:00

Exrail ASPECT(addr,value)

This commit is contained in:
Asbelos 2024-02-15 20:05:27 +00:00
parent 59b0e8383d
commit e4904e4080
4 changed files with 12 additions and 1 deletions

View File

@ -800,6 +800,11 @@ void RMFT2::loop2() {
DCC::setAccessory(addr,subaddr,active); DCC::setAccessory(addr,subaddr,active);
break; break;
} }
case OPCODE_ASPECT: {
// operand is address<<5 | value
DCC::setExtendedAccessory(operand>>5, operand & 0x1F);
break;
}
case OPCODE_FOLLOW: case OPCODE_FOLLOW:
progCounter=routeLookup->find(operand); progCounter=routeLookup->find(operand);

View File

@ -54,7 +54,7 @@ enum OPCODE : byte {OPCODE_THROW,OPCODE_CLOSE,
OPCODE_START,OPCODE_SETLOCO,OPCODE_SENDLOCO,OPCODE_FORGET, OPCODE_START,OPCODE_SETLOCO,OPCODE_SENDLOCO,OPCODE_FORGET,
OPCODE_PAUSE, OPCODE_RESUME,OPCODE_POWEROFF,OPCODE_POWERON, OPCODE_PAUSE, OPCODE_RESUME,OPCODE_POWEROFF,OPCODE_POWERON,
OPCODE_ONCLOSE, OPCODE_ONTHROW, OPCODE_SERVOTURNOUT, OPCODE_PINTURNOUT, OPCODE_ONCLOSE, OPCODE_ONTHROW, OPCODE_SERVOTURNOUT, OPCODE_PINTURNOUT,
OPCODE_PRINT,OPCODE_DCCACTIVATE, OPCODE_PRINT,OPCODE_DCCACTIVATE,OPCODE_ASPECT,
OPCODE_ONACTIVATE,OPCODE_ONDEACTIVATE, OPCODE_ONACTIVATE,OPCODE_ONDEACTIVATE,
OPCODE_ROSTER,OPCODE_KILLALL, OPCODE_ROSTER,OPCODE_KILLALL,
OPCODE_ROUTE,OPCODE_AUTOMATION,OPCODE_SEQUENCE, OPCODE_ROUTE,OPCODE_AUTOMATION,OPCODE_SEQUENCE,

View File

@ -31,6 +31,7 @@
#undef ALIAS #undef ALIAS
#undef AMBER #undef AMBER
#undef ANOUT #undef ANOUT
#undef ASPECT
#undef AT #undef AT
#undef ATGTE #undef ATGTE
#undef ATLT #undef ATLT
@ -186,6 +187,7 @@
#define AMBER(signal_id) #define AMBER(signal_id)
#define ANOUT(vpin,value,param1,param2) #define ANOUT(vpin,value,param1,param2)
#define AT(sensor_id) #define AT(sensor_id)
#define ASPECT(address,value)
#define ATGTE(sensor_id,value) #define ATGTE(sensor_id,value)
#define ATLT(sensor_id,value) #define ATLT(sensor_id,value)
#define ATTIMEOUT(sensor_id,timeout_ms) #define ATTIMEOUT(sensor_id,timeout_ms)

View File

@ -117,6 +117,9 @@ static_assert(!hasdup(compileTimeSequenceList[0],1),"Duplicate SEQUENCE/ROUTE/AU
// - check range on LATCH/UNLATCH // - check range on LATCH/UNLATCH
// This pass generates no runtime data or code // This pass generates no runtime data or code
#include "EXRAIL2MacroReset.h" #include "EXRAIL2MacroReset.h"
#undef ASPECT
#define ASPECT(address,value) static_assert((address & 0x7ff)== address, "invalid Address"); \
static_assert((value & 0x1F)== value, "Invalid value");
#undef CALL #undef CALL
#define CALL(id) static_assert(hasseq(id),"Sequence not found"); #define CALL(id) static_assert(hasseq(id),"Sequence not found");
#undef FOLLOW #undef FOLLOW
@ -432,6 +435,7 @@ int RMFT2::onLCCLookup[RMFT2::countLCCLookup];
#define ALIAS(name,value...) #define ALIAS(name,value...)
#define AMBER(signal_id) OPCODE_AMBER,V(signal_id), #define AMBER(signal_id) OPCODE_AMBER,V(signal_id),
#define ANOUT(vpin,value,param1,param2) OPCODE_SERVO,V(vpin),OPCODE_PAD,V(value),OPCODE_PAD,V(param1),OPCODE_PAD,V(param2), #define ANOUT(vpin,value,param1,param2) OPCODE_SERVO,V(vpin),OPCODE_PAD,V(value),OPCODE_PAD,V(param1),OPCODE_PAD,V(param2),
#define ASPECT(address,value) OPCODE_ASPECT,V((address<<5) | (value & 0x1F)),
#define AT(sensor_id) OPCODE_AT,V(sensor_id), #define AT(sensor_id) OPCODE_AT,V(sensor_id),
#define ATGTE(sensor_id,value) OPCODE_ATGTE,V(sensor_id),OPCODE_PAD,V(value), #define ATGTE(sensor_id,value) OPCODE_ATGTE,V(sensor_id),OPCODE_PAD,V(value),
#define ATLT(sensor_id,value) OPCODE_ATLT,V(sensor_id),OPCODE_PAD,V(value), #define ATLT(sensor_id,value) OPCODE_ATLT,V(sensor_id),OPCODE_PAD,V(value),