1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-27 01:56:14 +01:00

KILLALL macro

and DIAGNOSTIC messages when KILL command used.
This commit is contained in:
Asbelos 2022-03-31 21:52:43 +01:00
parent 566f8ada23
commit 731d838e83
4 changed files with 11 additions and 4 deletions

View File

@ -360,7 +360,7 @@ bool RMFT2::parseSlash(Print * stream, byte & paramCount, int16_t p[]) {
// check KILL ALL here, otherwise the next validation confuses ALL with a flag // check KILL ALL here, otherwise the next validation confuses ALL with a flag
if (p[0]==HASH_KEYWORD_KILL && p[1]==HASH_KEYWORD_ALL) { if (p[0]==HASH_KEYWORD_KILL && p[1]==HASH_KEYWORD_ALL) {
while (loopTask) delete loopTask; // destructor changes loopTask while (loopTask) loopTask->kill(F("KILL ALL")); // destructor changes loopTask
return true; return true;
} }
@ -373,7 +373,7 @@ bool RMFT2::parseSlash(Print * stream, byte & paramCount, int16_t p[]) {
RMFT2 * task=loopTask; RMFT2 * task=loopTask;
while(task) { while(task) {
if (task->taskId==p[1]) { if (task->taskId==p[1]) {
delete task; task->kill(F("KILL"));
return true; return true;
} }
task=task->next; task=task->next;
@ -813,6 +813,10 @@ void RMFT2::loop2() {
kill(); kill();
return; return;
case OPCODE_KILLALL:
while(loopTask) loopTask->kill(F("KILLALL"));
return;
case OPCODE_JOIN: case OPCODE_JOIN:
DCCWaveform::mainTrack.setPowerMode(POWERMODE::ON); DCCWaveform::mainTrack.setPowerMode(POWERMODE::ON);
DCCWaveform::progTrack.setPowerMode(POWERMODE::ON); DCCWaveform::progTrack.setPowerMode(POWERMODE::ON);

View File

@ -49,7 +49,7 @@ enum OPCODE : byte {OPCODE_THROW,OPCODE_CLOSE,
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_ONACTIVATE,OPCODE_ONDEACTIVATE,OPCODE_IFGTE,OPCODE_IFLT, OPCODE_ONACTIVATE,OPCODE_ONDEACTIVATE,OPCODE_IFGTE,OPCODE_IFLT,
OPCODE_ROSTER, OPCODE_ROSTER,OPCODE_KILLALL,
OPCODE_ROUTE,OPCODE_AUTOMATION,OPCODE_SEQUENCE,OPCODE_ENDTASK,OPCODE_ENDEXRAIL OPCODE_ROUTE,OPCODE_AUTOMATION,OPCODE_SEQUENCE,OPCODE_ENDTASK,OPCODE_ENDEXRAIL
}; };

View File

@ -69,6 +69,7 @@
#undef IFTIMEOUT #undef IFTIMEOUT
#undef INVERT_DIRECTION #undef INVERT_DIRECTION
#undef JOIN #undef JOIN
#undef KILLALL
#undef LATCH #undef LATCH
#undef LCD #undef LCD
#undef LCN #undef LCN
@ -166,6 +167,7 @@
#define IFTIMEOUT #define IFTIMEOUT
#define INVERT_DIRECTION #define INVERT_DIRECTION
#define JOIN #define JOIN
#define KILLALL
#define LATCH(sensor_id) #define LATCH(sensor_id)
#define LCD(row,msg) #define LCD(row,msg)
#define LCN(msg) #define LCN(msg)

View File

@ -215,6 +215,7 @@ const FLASH int16_t RMFT2::SignalDefinitions[] = {
#define IFTIMEOUT OPCODE_IFTIMEOUT,0,0, #define IFTIMEOUT OPCODE_IFTIMEOUT,0,0,
#define INVERT_DIRECTION OPCODE_INVERT_DIRECTION,0,0, #define INVERT_DIRECTION OPCODE_INVERT_DIRECTION,0,0,
#define JOIN OPCODE_JOIN,0,0, #define JOIN OPCODE_JOIN,0,0,
#define KILLALL OPCODE_KILLALL,0,0,
#define LATCH(sensor_id) OPCODE_LATCH,V(sensor_id), #define LATCH(sensor_id) OPCODE_LATCH,V(sensor_id),
#define LCD(id,msg) PRINT(msg) #define LCD(id,msg) PRINT(msg)
#define LCN(msg) PRINT(msg) #define LCN(msg) PRINT(msg)