mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-07-28 18:03:45 +02:00
Less confusion and simpler code around the RCN213 defines
This commit is contained in:
11
Turnouts.cpp
11
Turnouts.cpp
@@ -312,12 +312,6 @@
|
||||
*
|
||||
*************************************************************************************/
|
||||
|
||||
#if defined(DCC_TURNOUTS_RCN_213)
|
||||
const bool DCCTurnout::rcn213Compliant = true;
|
||||
#else
|
||||
const bool DCCTurnout::rcn213Compliant = false;
|
||||
#endif
|
||||
|
||||
// DCCTurnoutData contains data specific to this subclass that is
|
||||
// written to EEPROM when the turnout is saved.
|
||||
struct DCCTurnoutData {
|
||||
@@ -385,7 +379,10 @@
|
||||
// DCC++ Classic behaviour is that Throw writes a 1 in the packet,
|
||||
// and Close writes a 0.
|
||||
// RCN-213 specifies that Throw is 0 and Close is 1.
|
||||
DCC::setAccessory(_dccTurnoutData.address, _dccTurnoutData.subAddress, close ^ !rcn213Compliant);
|
||||
#if defined(DCC_TURNOUTS_RCN_213)
|
||||
close = !close;
|
||||
#endif
|
||||
DCC::setAccessory(_dccTurnoutData.address, _dccTurnoutData.subAddress, close);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user