From b9fdfdd71c516858fc2914452f0b3c02f10b31df Mon Sep 17 00:00:00 2001 From: mstevetodd Date: Fri, 11 Dec 2020 14:20:13 -0500 Subject: [PATCH] FIX: return WiThrottle speedstep, not DCC speedstep, in response to speed change request (#105) * FIX: return WiThrottle speedstep, not DCC speedstep, in response to speed change request. Should close #104 * use int, not byte for witSpeed --- 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;