mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-04-22 04:51:20 +02:00
Compare commits
No commits in common. "13488e1e93f1ddeaf55027b52e0cd27c1a55c26b" and "d4a99b5db5b03114d063c14890965e1d1d741a0f" have entirely different histories.
13488e1e93
...
d4a99b5db5
@ -72,19 +72,15 @@ void DCCACK::Setup(int cv, byte byteValueOrBitnum, ackOp const program[], ACK_C
|
|||||||
// then unjoin if necessary. This requires that the joined flag is
|
// then unjoin if necessary. This requires that the joined flag is
|
||||||
// cleared when the prog track is removed.
|
// cleared when the prog track is removed.
|
||||||
ackManagerRejoin=TrackManager::isJoined();
|
ackManagerRejoin=TrackManager::isJoined();
|
||||||
//DIAG(F("Joined is %d"), ackManagerRejoin);
|
|
||||||
if (ackManagerRejoin) {
|
if (ackManagerRejoin) {
|
||||||
// Change from JOIN must zero resets packet.
|
// Change from JOIN must zero resets packet.
|
||||||
TrackManager::setJoin(false);
|
TrackManager::setJoin(false);
|
||||||
DCCWaveform::progTrack.clearResets();
|
DCCWaveform::progTrack.clearResets();
|
||||||
}
|
}
|
||||||
|
|
||||||
progDriver=TrackManager::getProgDriver();
|
progDriver=TrackManager::getProgDriver();
|
||||||
//DIAG(F("Progdriver is %d"), progDriver);
|
|
||||||
if (progDriver==NULL) {
|
if (progDriver==NULL) {
|
||||||
if (ackManagerRejoin) {
|
TrackManager::setJoin(ackManagerRejoin);
|
||||||
DIAG(F("Joined but no Prog track"));
|
|
||||||
TrackManager::setJoin(false);
|
|
||||||
}
|
|
||||||
callback(-3); // we dont have a prog track!
|
callback(-3); // we dont have a prog track!
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
#define GITHUB_SHA "devel-202412222121Z"
|
#define GITHUB_SHA "devel-202412221258Z"
|
||||||
|
@ -356,24 +356,17 @@ bool TrackManager::setTrackMode(byte trackToSet, TRACK_MODE mode, int16_t dcAddr
|
|||||||
applyDCSpeed(trackToSet);
|
applyDCSpeed(trackToSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ARDUINO_ARCH_ESP32
|
|
||||||
#ifndef DISABLE_PROG
|
|
||||||
if (tempProgTrack == trackToSet && oldmode & TRACK_MODE_MAIN && !(mode & TRACK_MODE_PROG)) {
|
|
||||||
// If we just take away the prog track, the join should not
|
|
||||||
// be active either. So do in effect an unjoin
|
|
||||||
//DIAG(F("Unsync"));
|
|
||||||
tempProgTrack = MAX_TRACKS+1;
|
|
||||||
progTrackSyncMain=false;
|
|
||||||
if (joinRelay!=UNUSED_PIN) digitalWrite(joinRelay,LOW);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
// Turn off power if we changed the mode of this track
|
// Turn off power if we changed the mode of this track
|
||||||
if (mode != oldmode) {
|
if (mode != oldmode)
|
||||||
track[trackToSet]->setPower(POWERMODE::OFF);
|
track[trackToSet]->setPower(POWERMODE::OFF);
|
||||||
}
|
|
||||||
|
|
||||||
streamTrackState(NULL,trackToSet);
|
streamTrackState(NULL,trackToSet);
|
||||||
|
|
||||||
|
#ifndef DISABLE_PROG
|
||||||
|
// If no prog track exists, the join flag should not say that
|
||||||
|
// the prog track is joined either, so clear flag here
|
||||||
|
if (getProgDriver() == NULL) progTrackSyncMain=false;
|
||||||
|
#endif
|
||||||
|
|
||||||
//DIAG(F("TrackMode=%d"),mode);
|
//DIAG(F("TrackMode=%d"),mode);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user