diff --git a/DCC.cpp b/DCC.cpp index c4c167f..8b70e5d 100644 --- a/DCC.cpp +++ b/DCC.cpp @@ -95,32 +95,67 @@ bool DCC::getThrottleDirection(int cab) { return (speedTable[reg].speedCode & 0x80) !=0; } -void DCC::setFn( int cab, byte functionNumber, bool pressed) { +void DCC::setFn( int cab, byte functionNumber, bool on) { if (cab<=0 || functionNumber>28) return; int reg = lookupSpeedTable(cab); if (reg<0) return; + // Take care of functions: + // Set state of function + unsigned long funcmask = (1L<28) return funcstate; + int reg = lookupSpeedTable(cab); + if (reg<0) return funcstate; + // Take care of functions: // Imitate how many command stations do it: Button press is // toggle but for F2 where it is momentary + unsigned long funcmask = (1L<F%d%d\n"), throttleChar, LorS(myLocos[loco].cab), + myLocos[loco].cab, funcstate, fKey); + } } break; case 'q':