mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-23 08:06:13 +01:00
do not broadcast a turnout state that has not changed 2
This commit is contained in:
parent
1ec378281b
commit
8a425fe0ef
|
@ -1 +1 @@
|
||||||
#define GITHUB_SHA "devel-202303251113Z"
|
#define GITHUB_SHA "devel-202303251828Z"
|
||||||
|
|
10
Turnouts.cpp
10
Turnouts.cpp
|
@ -123,7 +123,7 @@
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define DIAG_IO
|
||||||
// Static setClosed function is invoked from close(), throw() etc. to perform the
|
// Static setClosed function is invoked from close(), throw() etc. to perform the
|
||||||
// common parts of the turnout operation. Code which is specific to a turnout
|
// common parts of the turnout operation. Code which is specific to a turnout
|
||||||
// type should be placed in the virtual function setClosedInternal(bool) which is
|
// type should be placed in the virtual function setClosedInternal(bool) which is
|
||||||
|
@ -289,7 +289,6 @@
|
||||||
#ifndef IO_NO_HAL
|
#ifndef IO_NO_HAL
|
||||||
IODevice::writeAnalogue(_servoTurnoutData.vpin,
|
IODevice::writeAnalogue(_servoTurnoutData.vpin,
|
||||||
close ? _servoTurnoutData.closedPosition : _servoTurnoutData.thrownPosition, _servoTurnoutData.profile);
|
close ? _servoTurnoutData.closedPosition : _servoTurnoutData.thrownPosition, _servoTurnoutData.profile);
|
||||||
_turnoutData.closed = close;
|
|
||||||
#else
|
#else
|
||||||
(void)close; // avoid compiler warnings
|
(void)close; // avoid compiler warnings
|
||||||
#endif
|
#endif
|
||||||
|
@ -387,7 +386,6 @@
|
||||||
// and Close writes a 0.
|
// and Close writes a 0.
|
||||||
// RCN-213 specifies that Throw is 0 and Close is 1.
|
// RCN-213 specifies that Throw is 0 and Close is 1.
|
||||||
DCC::setAccessory(_dccTurnoutData.address, _dccTurnoutData.subAddress, close ^ !rcn213Compliant);
|
DCC::setAccessory(_dccTurnoutData.address, _dccTurnoutData.subAddress, close ^ !rcn213Compliant);
|
||||||
_turnoutData.closed = close;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -463,7 +461,6 @@
|
||||||
|
|
||||||
bool VpinTurnout::setClosedInternal(bool close) {
|
bool VpinTurnout::setClosedInternal(bool close) {
|
||||||
IODevice::write(_vpinTurnoutData.vpin, close);
|
IODevice::write(_vpinTurnoutData.vpin, close);
|
||||||
_turnoutData.closed = close;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -514,7 +511,10 @@
|
||||||
bool LCNTurnout::setClosedInternal(bool close) {
|
bool LCNTurnout::setClosedInternal(bool close) {
|
||||||
// Assume that the LCN command still uses 1 for throw and 0 for close...
|
// Assume that the LCN command still uses 1 for throw and 0 for close...
|
||||||
LCN::send('T', _turnoutData.id, !close);
|
LCN::send('T', _turnoutData.id, !close);
|
||||||
// The _turnoutData.closed flag should be updated by a message from the LCN master, later.
|
// The _turnoutData.closed flag should be updated by a message from the LCN master.
|
||||||
|
// but in this implementation it is updated in setClosedStateOnly() instead.
|
||||||
|
// If the LCN master updates this, setClosedStateOnly() and all setClosedInternal()
|
||||||
|
// have to be updated accordingly so that the closed flag is only set once.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include "StringFormatter.h"
|
#include "StringFormatter.h"
|
||||||
|
|
||||||
|
|
||||||
#define VERSION "4.2.36rc1"
|
#define VERSION "4.2.36rc2"
|
||||||
// 4.2.36 - do not broadcast a turnout state that has not changed
|
// 4.2.36 - do not broadcast a turnout state that has not changed
|
||||||
// 4.2.35 - add <z> direct pin manipulation command
|
// 4.2.35 - add <z> direct pin manipulation command
|
||||||
// 4.2.34 - Completely fix EX-IOExpander analogue inputs
|
// 4.2.34 - Completely fix EX-IOExpander analogue inputs
|
||||||
|
|
Loading…
Reference in New Issue
Block a user