mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-23 21:01:25 +01:00
Merge pull request #37 from DCC-EX/Command-fixex
V fixes, R command and github sha.
This commit is contained in:
commit
79136b784c
@ -25,6 +25,7 @@
|
|||||||
#include "Outputs.h"
|
#include "Outputs.h"
|
||||||
#include "Sensors.h"
|
#include "Sensors.h"
|
||||||
#include "freeMemory.h"
|
#include "freeMemory.h"
|
||||||
|
#include "GITHUB_SHA.h"
|
||||||
|
|
||||||
#include "EEStore.h"
|
#include "EEStore.h"
|
||||||
#include "DIAG.h"
|
#include "DIAG.h"
|
||||||
@ -222,11 +223,17 @@ void DCCEXParser::parse(Print * stream, byte *com, bool blocking) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
case 'V': // VERIFY CV ON PROG <V CV VALUE> <V CV BIT 0|1>
|
case 'V': // VERIFY CV ON PROG <V CV VALUE> <V CV BIT 0|1>
|
||||||
if (!stashCallback(stream,p)) break;
|
if (params==2) { // <V CV VALUE>
|
||||||
if (params==2) DCC::verifyCVByte(p[0],p[1],callback_Vbyte,blocking);
|
if (!stashCallback(stream,p)) break;
|
||||||
else if (params==3) DCC::verifyCVBit(p[0],p[1],p[2],callback_Vbit,blocking);
|
DCC::verifyCVByte(p[0],p[1],callback_Vbyte,blocking);
|
||||||
else break;
|
return;
|
||||||
return;
|
}
|
||||||
|
if (params==3) {
|
||||||
|
if (!stashCallback(stream,p)) break;
|
||||||
|
DCC::verifyCVBit(p[0],p[1],p[2],callback_Vbit,blocking);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case 'B': // WRITE CV BIT ON PROG <B CV BIT VALUE CALLBACKNUM CALLBACKSUB>
|
case 'B': // WRITE CV BIT ON PROG <B CV BIT VALUE CALLBACKNUM CALLBACKSUB>
|
||||||
if (!stashCallback(stream,p)) break;
|
if (!stashCallback(stream,p)) break;
|
||||||
@ -234,10 +241,18 @@ void DCCEXParser::parse(Print * stream, byte *com, bool blocking) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
case 'R': // READ CV ON PROG <R CV CALLBACKNUM CALLBACKSUB>
|
case 'R': // READ CV ON PROG
|
||||||
if (!stashCallback(stream,p)) break;
|
if (params==3) { // <R CV CALLBACKNUM CALLBACKSUB>
|
||||||
DCC::readCV(p[0],callback_R,blocking);
|
if (!stashCallback(stream,p)) break;
|
||||||
return;
|
DCC::readCV(p[0],callback_R,blocking);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (params==0) { // <R> New read loco id
|
||||||
|
if (!stashCallback(stream,p)) break;
|
||||||
|
DCC::getLocoId(callback_Rloco,blocking);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case '1': // POWERON <1 [MAIN|PROG]>
|
case '1': // POWERON <1 [MAIN|PROG]>
|
||||||
case '0': // POWEROFF <0 [MAIN | PROG] >
|
case '0': // POWEROFF <0 [MAIN | PROG] >
|
||||||
@ -289,7 +304,7 @@ void DCCEXParser::parse(Print * stream, byte *com, bool blocking) {
|
|||||||
|
|
||||||
case 's': // <s>
|
case 's': // <s>
|
||||||
StringFormatter::send(stream,F("<p%d>"),DCCWaveform::mainTrack.getPowerMode()==POWERMODE::ON );
|
StringFormatter::send(stream,F("<p%d>"),DCCWaveform::mainTrack.getPowerMode()==POWERMODE::ON );
|
||||||
StringFormatter::send(stream,F("<iDCC-EX-API / V-%S %s/%s>"), VERSION, __DATE__, __TIME__ );
|
StringFormatter::send(stream,F("<iDCC-EX-API / V-%S G-%S>"), VERSION, F(GITHUB_SHA));
|
||||||
// TODO Send stats of speed reminders table
|
// TODO Send stats of speed reminders table
|
||||||
// TODO send status of turnouts etc etc
|
// TODO send status of turnouts etc etc
|
||||||
return;
|
return;
|
||||||
@ -532,3 +547,8 @@ void DCCEXParser::callback_R(int result) {
|
|||||||
stashBusy=false;
|
stashBusy=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DCCEXParser::callback_Rloco(int result) {
|
||||||
|
StringFormatter::send(stashStream,F("<r %d>"),result);
|
||||||
|
stashBusy=false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ struct DCCEXParser
|
|||||||
static void callback_W(int result);
|
static void callback_W(int result);
|
||||||
static void callback_B(int result);
|
static void callback_B(int result);
|
||||||
static void callback_R(int result);
|
static void callback_R(int result);
|
||||||
|
static void callback_Rloco(int result);
|
||||||
static void callback_Vbit(int result);
|
static void callback_Vbit(int result);
|
||||||
static void callback_Vbyte(int result);
|
static void callback_Vbyte(int result);
|
||||||
static FILTER_CALLBACK filterCallback;
|
static FILTER_CALLBACK filterCallback;
|
||||||
|
1
GITHUB_SHA.h
Normal file
1
GITHUB_SHA.h
Normal file
@ -0,0 +1 @@
|
|||||||
|
#define GITHUB_SHA "9db6d36"
|
Loading…
Reference in New Issue
Block a user