1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-07-28 09:53:45 +02:00

Cleanup and ACK debugs

This commit is contained in:
Asbelos
2020-07-01 16:58:48 +01:00
parent bec57345f1
commit 47a4d2dae9
5 changed files with 11 additions and 12 deletions

View File

@@ -45,7 +45,7 @@ void DCCEXParser::loop(Stream & stream) {
}
else if (ch == '>') {
buffer[bufferLength]='\0';
parse( stream, buffer);
parse( stream, buffer, false); // Parse this allowing async responses
inCommandPayload = false;
break;
} else if(inCommandPayload) {
@@ -109,8 +109,9 @@ void DCCEXParser::setFilter(FILTER_CALLBACK filter) {
}
// See documentation on DCC class for info on this section
void DCCEXParser::parse(Print & stream, const byte *com) {
void DCCEXParser::parse(Print & stream, const byte *com, bool banAsync) {
DIAG(F("\nPARSING:%s\n"),com);
asyncBanned=banAsync;
(void) EEPROM; // tell compiler not to warn thi is unused
int p[MAX_PARAMS];
byte params=splitValues(p, com);
@@ -353,7 +354,7 @@ bool DCCEXParser::parseS( Print & stream,int params, int p[]) {
// CALLBACKS must be static
bool DCCEXParser::stashCallback(Print & stream,int p[MAX_PARAMS]) {
if (stashBusy) return false;
if (stashBusy || asyncBanned) return false;
stashBusy=true;
stashStream=stream;
memcpy(stashP,p,MAX_PARAMS*sizeof(p[0]));