mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-23 12:51:24 +01:00
Fixed regression: Shields with common fault pin works again
This commit is contained in:
parent
5f878b5911
commit
e0a7c4d155
4
DCC.cpp
4
DCC.cpp
@ -733,6 +733,8 @@ void DCC::ackManagerSetup(int cv, byte byteValueOrBitnum, ackOp const program[]
|
|||||||
DCCWaveform::progTrack.autoPowerOff=true; // power off afterwards
|
DCCWaveform::progTrack.autoPowerOff=true; // power off afterwards
|
||||||
if (Diag::ACK) DIAG(F("Auto Prog power on"));
|
if (Diag::ACK) DIAG(F("Auto Prog power on"));
|
||||||
DCCWaveform::progTrack.setPowerMode(POWERMODE::ON);
|
DCCWaveform::progTrack.setPowerMode(POWERMODE::ON);
|
||||||
|
if (MotorDriver::commonFaultPin)
|
||||||
|
DCCWaveform::mainTrack.setPowerMode(POWERMODE::ON);
|
||||||
DCCWaveform::progTrack.sentResetsSincePacket = 0;
|
DCCWaveform::progTrack.sentResetsSincePacket = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -992,6 +994,8 @@ void DCC::callback(int value) {
|
|||||||
if (DCCWaveform::progTrack.autoPowerOff) {
|
if (DCCWaveform::progTrack.autoPowerOff) {
|
||||||
if (Diag::ACK) DIAG(F("Auto Prog power off"));
|
if (Diag::ACK) DIAG(F("Auto Prog power off"));
|
||||||
DCCWaveform::progTrack.doAutoPowerOff();
|
DCCWaveform::progTrack.doAutoPowerOff();
|
||||||
|
if (MotorDriver::commonFaultPin)
|
||||||
|
DCCWaveform::mainTrack.setPowerMode(POWERMODE::OFF);
|
||||||
}
|
}
|
||||||
// Restore <1 JOIN> to state before BASELINE
|
// Restore <1 JOIN> to state before BASELINE
|
||||||
if (ackManagerRejoin) {
|
if (ackManagerRejoin) {
|
||||||
|
@ -383,23 +383,24 @@ void DCCEXParser::parse(Print *stream, byte *com, RingStream * ringStream)
|
|||||||
bool prog=false;
|
bool prog=false;
|
||||||
bool join=false;
|
bool join=false;
|
||||||
if (params > 1) break;
|
if (params > 1) break;
|
||||||
if (params==0) { // <1>
|
if (params==0 || MotorDriver::commonFaultPin) { // <1> or tracks can not be handled individually
|
||||||
main=true;
|
main=true;
|
||||||
prog=true;
|
prog=true;
|
||||||
}
|
}
|
||||||
else if (p[0] == HASH_KEYWORD_JOIN) { // <1 JOIN>
|
if (params==1) {
|
||||||
|
if (p[0] == HASH_KEYWORD_JOIN) { // <1 JOIN>
|
||||||
main=true;
|
main=true;
|
||||||
prog=true;
|
prog=true;
|
||||||
join=!MotorDriver::commonFaultPin;
|
join=true;
|
||||||
}
|
}
|
||||||
else if (p[0]==HASH_KEYWORD_MAIN) { // <1 MAIN>
|
else if (p[0]==HASH_KEYWORD_MAIN) { // <1 MAIN>
|
||||||
main=true;
|
main=true;
|
||||||
}
|
}
|
||||||
else if (p[0]==HASH_KEYWORD_PROG) { // <1 PROG>
|
else if (p[0]==HASH_KEYWORD_PROG) { // <1 PROG>
|
||||||
prog=true;
|
prog=true;
|
||||||
}
|
}
|
||||||
else break; // will reply <X>
|
else break; // will reply <X>
|
||||||
|
}
|
||||||
if (main) DCCWaveform::mainTrack.setPowerMode(POWERMODE::ON);
|
if (main) DCCWaveform::mainTrack.setPowerMode(POWERMODE::ON);
|
||||||
if (prog) DCCWaveform::progTrack.setPowerMode(POWERMODE::ON);
|
if (prog) DCCWaveform::progTrack.setPowerMode(POWERMODE::ON);
|
||||||
DCC::setProgTrackSyncMain(join);
|
DCC::setProgTrackSyncMain(join);
|
||||||
@ -413,17 +414,19 @@ void DCCEXParser::parse(Print *stream, byte *com, RingStream * ringStream)
|
|||||||
bool main=false;
|
bool main=false;
|
||||||
bool prog=false;
|
bool prog=false;
|
||||||
if (params > 1) break;
|
if (params > 1) break;
|
||||||
if (params==0) { // <0>
|
if (params==0 || MotorDriver::commonFaultPin) { // <0> or tracks can not be handled individually
|
||||||
main=true;
|
main=true;
|
||||||
prog=true;
|
prog=true;
|
||||||
}
|
}
|
||||||
else if (p[0]==HASH_KEYWORD_MAIN) { // <0 MAIN>
|
if (params==1) {
|
||||||
main=true;
|
if (p[0]==HASH_KEYWORD_MAIN) { // <0 MAIN>
|
||||||
}
|
main=true;
|
||||||
else if (p[0]==HASH_KEYWORD_PROG) { // <0 PROG>
|
}
|
||||||
prog=true;
|
else if (p[0]==HASH_KEYWORD_PROG) { // <0 PROG>
|
||||||
}
|
prog=true;
|
||||||
else break; // will reply <X>
|
}
|
||||||
|
else break; // will reply <X>
|
||||||
|
}
|
||||||
|
|
||||||
if (main) DCCWaveform::mainTrack.setPowerMode(POWERMODE::OFF);
|
if (main) DCCWaveform::mainTrack.setPowerMode(POWERMODE::OFF);
|
||||||
if (prog) {
|
if (prog) {
|
||||||
|
Loading…
Reference in New Issue
Block a user