1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-07-28 09:53:45 +02:00

Add flag to invert DCC Accessory command <a> behaviour

<a addr subaddr 1> command puts a D=1 into the DCC packet for a DCC Accessory Decoder.  This was previously though to correspond to a 'throw' request and a D=0 to a 'close' request.  RCN-213 standard identifies that D=1 is 'close' and D=0 is 'throw', so this change allows CS to be configured to invert the states to conform to the RCN-213 definition.
This commit is contained in:
Neil McKechnie
2021-08-27 21:43:24 +01:00
parent 23ed4e61af
commit fb6ab85c4a
3 changed files with 17 additions and 3 deletions

View File

@@ -239,6 +239,9 @@ void DCC::updateGroupflags(byte & flags, int16_t functionNumber) {
}
void DCC::setAccessory(int address, byte number, bool activate) {
#ifdef DIAG_IO
DIAG(F("DCC::setAccessory(%d,%d,%d)"), address, number, activate);
#endif
// use masks to detect wrong values and do nothing
if(address != (address & 511))
return;