mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-25 05:31:24 +01:00
Implement # command
This commit is contained in:
parent
a2636b1296
commit
0a3d2e7595
@ -43,10 +43,10 @@ void myFilter(Print & stream, byte & opcode, byte & paramCount, int p[]) {
|
|||||||
DCC::setFn(p[0],p[1],p[2]==1);
|
DCC::setFn(p[0],p[1],p[2]==1);
|
||||||
opcode=0; // tell parser to ignore this command
|
opcode=0; // tell parser to ignore this command
|
||||||
break;
|
break;
|
||||||
case '#': // Diagnose parser <#....>
|
case '$': // Diagnose parser <$....>
|
||||||
DIAG(F("# paramCount=%d\n"),paramCount);
|
DIAG(F("$ paramCount=%d\n"),paramCount);
|
||||||
for (int i=0;i<paramCount;i++) DIAG(F("p[%d]=%d (0x%x)\n"),i,p[i],p[i]);
|
for (int i=0;i<paramCount;i++) DIAG(F("p[%d]=%d (0x%x)\n"),i,p[i],p[i]);
|
||||||
opcode=0; // Normal parser wont understand #,
|
opcode=0; // Normal parser wont understand $,
|
||||||
break;
|
break;
|
||||||
default: // drop through and parser will use the command unaltered.
|
default: // drop through and parser will use the command unaltered.
|
||||||
break;
|
break;
|
||||||
|
@ -251,6 +251,10 @@ void DCCEXParser::parse(Print & stream, const byte *com, bool banAsync) {
|
|||||||
DIAG(F("\nDCC DEBUG MODE %d"),p[0]==1);
|
DIAG(F("\nDCC DEBUG MODE %d"),p[0]==1);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
case '#': // NUMBER OF LOCOSLOTS <#>
|
||||||
|
StringFormatter::send(stream,F("<# %d>"), MAX_LOCOS);
|
||||||
|
return;
|
||||||
|
|
||||||
default: //anything else will drop out to <X>
|
default: //anything else will drop out to <X>
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user