mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-01-28 21:23:06 +01:00
changeFn fix
This commit is contained in:
parent
2f1d5b993c
commit
fb6070784e
11
DCC.cpp
11
DCC.cpp
@ -268,14 +268,9 @@ bool DCC::setFn( int cab, int16_t functionNumber, bool on) {
|
||||
|
||||
// Flip function state (used from withrottle protocol)
|
||||
void DCC::changeFn( int cab, int16_t functionNumber) {
|
||||
if (cab<=0 || functionNumber>31) return;
|
||||
auto slot=lookupSpeedTable(cab);
|
||||
unsigned long funcmask = (1UL<<functionNumber);
|
||||
slot->functions ^= funcmask;
|
||||
if (functionNumber <= 28) {
|
||||
updateGroupflags(slot->groupFlags, functionNumber);
|
||||
}
|
||||
CommandDistributor::broadcastLoco(slot);
|
||||
auto currentValue=getFn(cab,functionNumber);
|
||||
if (currentValue<0) return; // function not valid for change
|
||||
setFn(cab,functionNumber, currentValue?false:true);
|
||||
}
|
||||
|
||||
// Report function state (used from withrottle protocol)
|
||||
|
@ -3,7 +3,8 @@
|
||||
|
||||
#include "StringFormatter.h"
|
||||
|
||||
#define VERSION "5.5.8"
|
||||
#define VERSION "5.5.9"
|
||||
// 5.5.9 = (5.4.3) fix changeFn for functions 29..31
|
||||
// 5.5.8 - EXSensorCam clean up to match other filters and
|
||||
// - avoid need for config.h settings
|
||||
// - Test: IO_I2CDFPlayer.h inserted 10mS deleay in Init_SC16IS752() just after soft-reset for board with 1.8432 Mhz xtal
|
||||
|
Loading…
Reference in New Issue
Block a user