From 73b532508587a6b1d10ba65c448ba2b6ab85b0a7 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Fri, 11 Dec 2020 19:03:05 +0100 Subject: [PATCH 1/2] better speed step comment --- DCCEXParser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index 3d3bed6..176e09c 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -272,7 +272,8 @@ void DCCEXParser::parse(Print *stream, byte *com, bool blocking) else break; - // Convert JMRI bizarre -1=emergency stop, 0-126 as speeds + // Convert DCC-EX protocol speed steps where + // -1=emergency stop, 0-126 as speeds // to DCC 0=stop, 1= emergency stop, 2-127 speeds if (tspeed > 126 || tspeed < -1) break; // invalid JMRI speed code From 89073bd3115e5cd2f4d7b4284f4fe189cd1b70a1 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Fri, 11 Dec 2020 19:11:17 +0100 Subject: [PATCH 2/2] give back witspeed not converted (DCC) locospeed --- WiThrottle.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WiThrottle.cpp b/WiThrottle.cpp index 61f7f92..d9b9ec7 100644 --- a/WiThrottle.cpp +++ b/WiThrottle.cpp @@ -262,10 +262,10 @@ void WiThrottle::locoAction(RingStream * stream, byte* aval, char throttleChar, switch (aval[0]) { case 'V': // Vspeed { - byte locospeed=WiTToDCCSpeed(getInt(aval+1)); + int witSpeed=getInt(aval+1); LOOPLOCOS(throttleChar, cab) { - DCC::setThrottle(myLocos[loco].cab, locospeed, DCC::getThrottleDirection(myLocos[loco].cab)); - StringFormatter::send(stream,F("M%cA%c%d<;>V%d\n"), throttleChar, LorS(myLocos[loco].cab), myLocos[loco].cab, locospeed); + DCC::setThrottle(myLocos[loco].cab, WiTToDCCSpeed(witSpeed), DCC::getThrottleDirection(myLocos[loco].cab)); + StringFormatter::send(stream,F("M%cA%c%d<;>V%d\n"), throttleChar, LorS(myLocos[loco].cab), myLocos[loco].cab, witSpeed); } } break;