1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-23 21:01:25 +01:00

Merge branch 'ServoSignal' into TrackManager

This commit is contained in:
Asbelos 2022-03-28 14:56:27 +01:00
commit 5adabcd1af
5 changed files with 31 additions and 6 deletions

View File

@ -63,6 +63,7 @@ const int16_t HASH_KEYWORD_UNLATCH=1353;
const int16_t HASH_KEYWORD_PAUSE=-4142;
const int16_t HASH_KEYWORD_RESUME=27609;
const int16_t HASH_KEYWORD_KILL=5218;
const int16_t HASH_KEYWORD_ALL=3457;
const int16_t HASH_KEYWORD_ROUTES=-3702;
// One instance of RMFT clas is used for each "thread" in the automation.
@ -362,8 +363,13 @@ bool RMFT2::parseSlash(Print * stream, byte & paramCount, int16_t p[]) {
if (paramCount!=2 || p[1]<0 || p[1]>=MAX_FLAGS) return false;
switch (p[0]) {
case HASH_KEYWORD_KILL: // Kill taskid
case HASH_KEYWORD_KILL: // Kill taskid|ALL
{
if (p[1]==HASH_KEYWORD_ALL) {
while (loopTask) delete loopTask;
return true;
}
RMFT2 * task=loopTask;
while(task) {
if (task->taskId==p[1]) {
@ -574,6 +580,13 @@ void RMFT2::loop2() {
driveLoco(operand);
break;
case OPCODE_FORGET:
if (loco!=0) {
DCC::forgetLoco(loco);
loco=0;
}
break;
case OPCODE_INVERT_DIRECTION:
invert= !invert;
driveLoco(speedo);

View File

@ -44,7 +44,7 @@ enum OPCODE : byte {OPCODE_THROW,OPCODE_CLOSE,
OPCODE_SERVO,OPCODE_SIGNAL,OPCODE_TURNOUT,OPCODE_WAITFOR,
OPCODE_PAD,OPCODE_FOLLOW,OPCODE_CALL,OPCODE_RETURN,
OPCODE_JOIN,OPCODE_UNJOIN,OPCODE_READ_LOCO1,OPCODE_READ_LOCO2,OPCODE_POM,
OPCODE_START,OPCODE_SETLOCO,OPCODE_SENDLOCO,
OPCODE_START,OPCODE_SETLOCO,OPCODE_SENDLOCO,OPCODE_FORGET,
OPCODE_PAUSE, OPCODE_RESUME,OPCODE_POWEROFF,OPCODE_POWERON,
OPCODE_ONCLOSE, OPCODE_ONTHROW, OPCODE_SERVOTURNOUT, OPCODE_PINTURNOUT,
OPCODE_PRINT,OPCODE_DCCACTIVATE,

View File

@ -54,6 +54,7 @@
#undef FOFF
#undef FOLLOW
#undef FON
#undef FORGET
#undef FREE
#undef FWD
#undef GREEN
@ -114,6 +115,7 @@
#undef TURNOUT
#undef UNJOIN
#undef UNLATCH
#undef VIRTUAL_TURNOUT
#undef WAITFOR
#undef XFOFF
#undef XFON
@ -150,6 +152,7 @@
#define FOFF(func)
#define FOLLOW(route)
#define FON(func)
#define FORGET
#define FREE(blockid)
#define FWD(speed)
#define GREEN(signal_id)
@ -210,6 +213,7 @@
#define TURNOUT(id,addr,subaddr,description...)
#define UNJOIN
#define UNLATCH(sensor_id)
#define VIRTUAL_TURNOUT(id,description...)
#define WAITFOR(pin)
#define XFOFF(cab,func)
#define XFON(cab,func)

View File

@ -102,6 +102,8 @@ void RMFT2::printMessage(uint16_t id) {
#define PIN_TURNOUT(id,pin,description...) case id: desc=F("" description); break;
#undef SERVO_TURNOUT
#define SERVO_TURNOUT(id,pin,activeAngle,inactiveAngle,profile,description...) case id: desc=F("" description); break;
#undef VIRTUAL_TURNOUT
#define VIRTUAL_TURNOUT(id,description...) case id: desc=F("" description); break;
void RMFT2::emitTurnoutDescription(Print* stream,int16_t turnoutid) {
const FSH * desc=F("");
@ -198,6 +200,7 @@ const FLASH int16_t RMFT2::SignalDefinitions[] = {
#define FOFF(func) OPCODE_FOFF,V(func),
#define FOLLOW(route) OPCODE_FOLLOW,V(route),
#define FON(func) OPCODE_FON,V(func),
#define FORGET OPCODE_FORGET,0,0,
#define FREE(blockid) OPCODE_FREE,V(blockid),
#define FWD(speed) OPCODE_FWD,V(speed),
#define GREEN(signal_id) OPCODE_GREEN,V(signal_id),
@ -258,6 +261,7 @@ const FLASH int16_t RMFT2::SignalDefinitions[] = {
#define TURNOUT(id,addr,subaddr,description...) OPCODE_TURNOUT,V(id),OPCODE_PAD,V(addr),OPCODE_PAD,V(subaddr),
#define UNJOIN OPCODE_UNJOIN,0,0,
#define UNLATCH(sensor_id) OPCODE_UNLATCH,V(sensor_id),
#define VIRTUAL_TURNOUT(id,description...) OPCODE_PINTURNOUT,V(id),OPCODE_PAD,V(0),
#define WAITFOR(pin) OPCODE_WAITFOR,V(pin),
#define XFOFF(cab,func) OPCODE_XFOFF,V(cab),OPCODE_PAD,V(func),
#define XFON(cab,func) OPCODE_XFON,V(cab),OPCODE_PAD,V(func),

View File

@ -9,13 +9,17 @@
// SET_TRACK(track,mode) Functions (A-H, MAIN|PROG|DC|DCX|OFF)
// New DC track function and DCX reverse polarity function
// TrackManager DCC & DC up to 8 Districts Architecture
// 4.0.2 EXRAIL additions:
// Automatic ALIAS(name)
// DCCEXPArser.cpp now accepts Underscore in Alias Names
// Command Parser now accepts Underscore in Alias Names
// 4.0.2 EXRAIL additions:
// VIRTUAL_TURNOUT
// </KILL ALL> command to stop all tasks.
// FORGET forgets the current loco in DCC reminder tables.
// Servo signals (SERVO_SIGNAL)
// High-On signal pins (SIGNALH)
// Wait for analog value (ATGTE, ATLT)
// 4.0.1 EXRAIL BROADCAST("msg")
// 4.0.1 Small EXRAIL updates
// EXRAIL BROADCAST("msg")
// EXRAIL POWERON
// 4.0.0 Major functional and non-functional changes.
// Engine Driver "DriveAway" feature enhancement