mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-01-11 13:21:01 +01:00
Signal pin corrections
This commit is contained in:
parent
afe9141671
commit
9d5781a87c
@ -674,14 +674,14 @@ void RMFT2::kill(const FSH * reason, int operand) {
|
||||
byte opcode=GET_OPCODE;
|
||||
if (opcode==OPCODE_ENDEXRAIL) return;
|
||||
if (opcode!=OPCODE_SIGNAL) continue;
|
||||
byte redpin=GET_OPERAND(1);
|
||||
byte redpin=GET_OPERAND(0);
|
||||
if (redpin!=id)continue;
|
||||
byte amberpin=GET_OPERAND(2);
|
||||
byte greenpin=GET_OPERAND(3);
|
||||
byte amberpin=GET_OPERAND(1);
|
||||
byte greenpin=GET_OPERAND(2);
|
||||
// If amberpin is zero, synthesise amber from red+green
|
||||
IODevice::write(redpin,red || (amber && (amberpin==0)));
|
||||
if (amberpin) IODevice::write(amberpin,amber);
|
||||
if (greenpin) IODevice::write(amberpin,green || (amber && (amberpin==0)));
|
||||
if (greenpin) IODevice::write(greenpin,green || (amber && (amberpin==0)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user