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

Broadcast if group changed

This commit is contained in:
Asbelos 2021-12-14 11:50:59 +00:00
parent 985f0e777c
commit 96933ed516

10
DCC.cpp
View File

@ -179,15 +179,17 @@ void DCC::setFn( int cab, int16_t functionNumber, bool on) {
// Take care of functions:
// Set state of function
unsigned long previous=speedTable[reg].functions;
unsigned long funcmask = (1UL<<functionNumber);
if (on) {
if (on) {
speedTable[reg].functions |= funcmask;
} else {
speedTable[reg].functions &= ~funcmask;
}
updateGroupflags(speedTable[reg].groupFlags, functionNumber);
CommandDistributor::broadcastLoco(reg);
return;
if (speedTable[reg].functions != previous) {
updateGroupflags(speedTable[reg].groupFlags, functionNumber);
CommandDistributor::broadcastLoco(reg);
}
}
// Change function according to how button was pressed,