mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-24 13:21:23 +01:00
Trackmanager: Do not treat TRACK_MODE_ALL as TRACK_MODE_DC
This commit is contained in:
parent
102d6078a7
commit
74d11ccb1e
@ -472,12 +472,13 @@ std::vector<MotorDriver *>TrackManager::getMainDrivers() {
|
||||
#endif
|
||||
|
||||
// Set track power for all tracks with this mode
|
||||
void TrackManager::setTrackPower(TRACK_MODE trackmode, POWERMODE powermode) {
|
||||
void TrackManager::setTrackPower(TRACK_MODE trackmodeToMatch, POWERMODE powermode) {
|
||||
FOR_EACH_TRACK(t) {
|
||||
MotorDriver *driver=track[t];
|
||||
if (trackmode & driver->getMode()) {
|
||||
TRACK_MODE trackmodeOfTrack = driver->getMode();
|
||||
if (trackmodeToMatch & trackmodeOfTrack) {
|
||||
if (powermode == POWERMODE::ON) {
|
||||
if (trackmode & TRACK_MODE_DC) {
|
||||
if (trackmodeOfTrack & TRACK_MODE_DC) {
|
||||
driver->setBrake(true); // DC starts with brake on
|
||||
applyDCSpeed(t); // speed match DCC throttles
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user