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

Blocking progtrack call optoin

Note, as yet UNTESTED
This commit is contained in:
Asbelos
2020-07-19 18:39:08 +01:00
parent 0ea0cc6391
commit 2ae7aedcd2
4 changed files with 60 additions and 38 deletions

View File

@@ -127,9 +127,8 @@ void DCCEXParser::setFilter(FILTER_CALLBACK filter) {
}
// See documentation on DCC class for info on this section
void DCCEXParser::parse(Print & stream, const byte *com, bool banAsync) {
void DCCEXParser::parse(Print & stream, const byte *com, bool blocking) {
DIAG(F("\nPARSING:%s\n"),com);
asyncBanned=banAsync;
(void) EEPROM; // tell compiler not to warn thi is unused
int p[MAX_PARAMS];
while (com[0]=='<' || com[0]==' ') com++; // strip off any number of < or spaces
@@ -177,17 +176,17 @@ void DCCEXParser::parse(Print & stream, const byte *com, bool banAsync) {
case 'W': // WRITE CV ON PROG <W CV VALUE CALLBACKNUM CALLBACKSUB>
if (!stashCallback(stream,p)) break;
DCC::writeCVByte(p[0],p[1],callback_W);
DCC::writeCVByte(p[0],p[1],callback_W,blocking);
return;
case 'B': // WRITE CV BIT ON PROG <B CV BIT VALUE CALLBACKNUM CALLBACKSUB>
if (!stashCallback(stream,p)) break;
DCC::writeCVBit(p[0],p[1],p[2],callback_B);
DCC::writeCVBit(p[0],p[1],p[2],callback_B,blocking);
return;
case 'R': // READ CV ON PROG <R CV CALLBACKNUM CALLBACKSUB>
if (!stashCallback(stream,p)) break;
DCC::readCV(p[0],callback_R);
DCC::readCV(p[0],callback_R,blocking);
return;
case '1': // POWERON <1 [MAIN|PROG]>