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

Merge pull request #3 from Asbelos/hash

Hash
This commit is contained in:
Asbelos 2020-07-12 08:58:43 +01:00 committed by GitHub
commit 98ce3ae5d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -43,10 +43,10 @@ void myFilter(Print & stream, byte & opcode, byte & paramCount, int p[]) {
DCC::setFn(p[0],p[1],p[2]==1);
opcode=0; // tell parser to ignore this command
break;
case '#': // Diagnose parser <#....>
DIAG(F("# paramCount=%d\n"),paramCount);
case '$': // Diagnose parser <$....>
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]);
opcode=0; // Normal parser wont understand #,
opcode=0; // Normal parser wont understand $,
break;
default: // drop through and parser will use the command unaltered.
break;

View File

@ -249,6 +249,10 @@ void DCCEXParser::parse(Print & stream, const byte *com, bool banAsync) {
DCC::setDebug(p[0]==1);
DIAG(F("\nDCC DEBUG MODE %d"),p[0]==1);
return;
case '#': // NUMBER OF LOCOSLOTS <#>
StringFormatter::send(stream,F("<# %d>"), MAX_LOCOS);
return;
default: //anything else will drop out to <X>
break;