1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-01-22 02:28:52 +01:00

5.4.2 bugfix fn31 flip

This commit is contained in:
Asbelos 2025-01-20 20:03:21 +00:00
parent 830de850a9
commit 2115ada2a1
2 changed files with 5 additions and 10 deletions

12
DCC.cpp
View File

@ -229,15 +229,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;
int reg = lookupSpeedTable(cab);
if (reg<0) return;
unsigned long funcmask = (1UL<<functionNumber);
speedTable[reg].functions ^= funcmask;
if (functionNumber <= 28) {
updateGroupflags(speedTable[reg].groupFlags, functionNumber);
}
CommandDistributor::broadcastLoco(reg);
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)

View File

@ -3,7 +3,8 @@
#include "StringFormatter.h"
#define VERSION "5.4.1"
#define VERSION "5.4.2"
// 5.4.2 - Bugfix function flip >28
// 5.4.1 - ESP32 bugfix packet buffer race
// 5.4.0 - New version on master
// 5.2.96 - EXRAIL additions XFWD() and XREV()