mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-25 05:31:24 +01:00
SIGNAL/SIGNALH operating correctly
This commit is contained in:
parent
fb36bd1380
commit
fb9170ab8b
21
EXRAIL2.cpp
21
EXRAIL2.cpp
@ -1078,9 +1078,24 @@ int16_t RMFT2::getSignalSlot(int16_t id) {
|
|||||||
bool aHigh=sigid & ACTIVE_HIGH_SIGNAL_FLAG;
|
bool aHigh=sigid & ACTIVE_HIGH_SIGNAL_FLAG;
|
||||||
|
|
||||||
// set the three pins
|
// set the three pins
|
||||||
if (redpin) IODevice::write(redpin,(rag==SIGNAL_RED || rag==SIMAMBER)^aHigh);
|
if (redpin) {
|
||||||
if (amberpin) IODevice::write(amberpin,(rag==SIGNAL_AMBER)^aHigh);
|
bool redval=(rag==SIGNAL_RED || rag==SIMAMBER);
|
||||||
if (greenpin) IODevice::write(greenpin,(rag==SIGNAL_GREEN || rag==SIMAMBER)^aHigh);
|
if (!aHigh) redval=!redval;
|
||||||
|
// IODevice::write(redpin,(rag==SIGNAL_RED || rag==SIMAMBER)^aHigh);
|
||||||
|
IODevice::write(redpin,redval);
|
||||||
|
}
|
||||||
|
if (amberpin) {
|
||||||
|
// IODevice::write(amberpin,(rag==SIGNAL_AMBER)^aHigh);
|
||||||
|
bool amberval=(rag==SIGNAL_AMBER);
|
||||||
|
if (!aHigh) amberval=!amberval;
|
||||||
|
IODevice::write(amberpin,amberval);
|
||||||
|
}
|
||||||
|
if (greenpin) {
|
||||||
|
// IODevice::write(greenpin,(rag==SIGNAL_GREEN || rag==SIMAMBER)^aHigh);
|
||||||
|
bool greenval=(rag==SIGNAL_GREEN || rag==SIMAMBER);
|
||||||
|
if (!aHigh) greenval=!greenval;
|
||||||
|
IODevice::write(greenpin,greenval);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ bool RMFT2::isSignal(int16_t id,char rag) {
|
/* static */ bool RMFT2::isSignal(int16_t id,char rag) {
|
||||||
|
Loading…
Reference in New Issue
Block a user