diff --git a/DCC.cpp b/DCC.cpp index ecc11af..c4c167f 100644 --- a/DCC.cpp +++ b/DCC.cpp @@ -1,5 +1,6 @@ /* * © 2020, Chris Harlow. All rights reserved. + * © 2020, Harald Barth * * This file is part of Asbelos DCC API * @@ -94,22 +95,32 @@ bool DCC::getThrottleDirection(int cab) { return (speedTable[reg].speedCode & 0x80) !=0; } - void DCC::setFn( int cab, byte functionNumber, bool on) { +void DCC::setFn( int cab, byte functionNumber, bool pressed) { if (cab<=0 || functionNumber>28) return; int reg = lookupSpeedTable(cab); if (reg<0) return; - // set the function on/off in the functions and set the group flag to - // say we have touched the particular group. - // A group will be reminded only if it has been touched. - if (on) speedTable[reg].functions |= (1L<