1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-27 01:56:14 +01:00

fix initial fn strings, return value of F16-F28 (#132)

* Committing a SHA

* fix initial fn strings, return value of F16-F28
This commit is contained in:
mstevetodd 2021-03-08 21:46:08 -05:00 committed by GitHub
parent 5f34fc396a
commit 79a318b455
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -157,7 +157,7 @@ int DCC::changeFn( int cab, byte functionNumber, bool pressed) {
if (pressed) { if (pressed) {
speedTable[reg].functions ^= funcmask; speedTable[reg].functions ^= funcmask;
} }
funcstate = speedTable[reg].functions & funcmask; funcstate = (speedTable[reg].functions & funcmask)? 1 : 0;
} }
updateGroupflags(speedTable[reg].groupFlags, functionNumber); updateGroupflags(speedTable[reg].groupFlags, functionNumber);
return funcstate; return funcstate;

View File

@ -236,7 +236,7 @@ void WiThrottle::multithrottle(RingStream * stream, byte * cmd){
//Get known Fn states from DCC //Get known Fn states from DCC
for(int fKey=0; fKey<=28; fKey++) { for(int fKey=0; fKey<=28; fKey++) {
int fstate=DCC::getFn(locoid,fKey); int fstate=DCC::getFn(locoid,fKey);
if (fstate>=0) StringFormatter::send(stream,F("M%cA%c<;>F%d%d\n"),throttleChar,cmd[3],fstate,fKey); if (fstate>=0) StringFormatter::send(stream,F("M%cA%c%d<;>F%d%d\n"),throttleChar,cmd[3],locoid,fstate,fKey);
} }
StringFormatter::send(stream, F("M%cA%c%d<;>V%d\n"), throttleChar, cmd[3], locoid, DCCToWiTSpeed(DCC::getThrottleSpeed(locoid))); StringFormatter::send(stream, F("M%cA%c%d<;>V%d\n"), throttleChar, cmd[3], locoid, DCCToWiTSpeed(DCC::getThrottleSpeed(locoid)));
StringFormatter::send(stream, F("M%cA%c%d<;>R%d\n"), throttleChar, cmd[3], locoid, DCC::getThrottleDirection(locoid)); StringFormatter::send(stream, F("M%cA%c%d<;>R%d\n"), throttleChar, cmd[3], locoid, DCC::getThrottleDirection(locoid));