1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-26 17:46:14 +01:00

do not broadcast a turnout state that has not changed 2

This commit is contained in:
Harald Barth 2023-03-25 19:28:37 +01:00
parent 1ec378281b
commit 8a425fe0ef
3 changed files with 7 additions and 7 deletions

View File

@ -1 +1 @@
#define GITHUB_SHA "devel-202303251113Z"
#define GITHUB_SHA "devel-202303251828Z"

View File

@ -123,7 +123,7 @@
return true;
}
#define DIAG_IO
// 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
// type should be placed in the virtual function setClosedInternal(bool) which is
@ -289,7 +289,6 @@
#ifndef IO_NO_HAL
IODevice::writeAnalogue(_servoTurnoutData.vpin,
close ? _servoTurnoutData.closedPosition : _servoTurnoutData.thrownPosition, _servoTurnoutData.profile);
_turnoutData.closed = close;
#else
(void)close; // avoid compiler warnings
#endif
@ -387,7 +386,6 @@
// and Close writes a 0.
// RCN-213 specifies that Throw is 0 and Close is 1.
DCC::setAccessory(_dccTurnoutData.address, _dccTurnoutData.subAddress, close ^ !rcn213Compliant);
_turnoutData.closed = close;
return true;
}
@ -463,7 +461,6 @@
bool VpinTurnout::setClosedInternal(bool close) {
IODevice::write(_vpinTurnoutData.vpin, close);
_turnoutData.closed = close;
return true;
}
@ -514,7 +511,10 @@
bool LCNTurnout::setClosedInternal(bool close) {
// Assume that the LCN command still uses 1 for throw and 0 for 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;
}

View File

@ -4,7 +4,7 @@
#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.35 - add <z> direct pin manipulation command
// 4.2.34 - Completely fix EX-IOExpander analogue inputs