Skip to content

Commit

Permalink
Functions for DC frequency: Use func up to F31 part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
habazut committed Mar 12, 2024
1 parent 8eec85e commit e3081a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions DCC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,9 @@ bool DCC::setFn( int cab, int16_t functionNumber, bool on) {
} else {
speedTable[reg].functions &= ~funcmask;
}
if (speedTable[reg].functions != previous && functionNumber <= 28) {
updateGroupflags(speedTable[reg].groupFlags, functionNumber);
if (speedTable[reg].functions != previous) {
if (functionNumber <= 28)
updateGroupflags(speedTable[reg].groupFlags, functionNumber);
CommandDistributor::broadcastLoco(reg);
}
return true;
Expand All @@ -235,8 +236,8 @@ void DCC::changeFn( int cab, int16_t functionNumber) {
speedTable[reg].functions ^= funcmask;
if (functionNumber <= 28) {
updateGroupflags(speedTable[reg].groupFlags, functionNumber);
CommandDistributor::broadcastLoco(reg);
}
CommandDistributor::broadcastLoco(reg);
}

// Report function state (used from withrottle protocol)
Expand Down
2 changes: 1 addition & 1 deletion WiThrottle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ void WiThrottle::sendRoutes(Print* stream) {

void WiThrottle::sendFunctions(Print* stream, byte loco) {
int16_t locoid=myLocos[loco].cab;
int fkeys=29;
int fkeys=32; // upper limit (send functions 0 to 31)
myLocos[loco].functionToggles=1<<2; // F2 (HORN) is a non-toggle

#ifdef EXRAIL_ACTIVE
Expand Down

0 comments on commit e3081a7

Please sign in to comment.