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

clear progTrackSyncMain (join flag) when prog track is removed

This commit is contained in:
Harald Barth
2024-12-21 15:42:15 +01:00
parent 4f16091670
commit 8329fd83ce
2 changed files with 10 additions and 0 deletions

View File

@@ -361,6 +361,12 @@ bool TrackManager::setTrackMode(byte trackToSet, TRACK_MODE mode, int16_t dcAddr
track[trackToSet]->setPower(POWERMODE::OFF);
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);
return true;
}