mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-26 17:46:14 +01:00
Protect Uno user from choosing DC(X)
This commit is contained in:
parent
415e756020
commit
e3ac3a8ddf
|
@ -192,11 +192,16 @@ bool TrackManager::setTrackMode(byte trackToSet, TRACK_MODE mode, int16_t dcAddr
|
||||||
|
|
||||||
//DIAG(F("Track=%c Mode=%d"),trackToSet+'A', mode);
|
//DIAG(F("Track=%c Mode=%d"),trackToSet+'A', mode);
|
||||||
// DC tracks require a motorDriver that can set brake!
|
// DC tracks require a motorDriver that can set brake!
|
||||||
if ((mode==TRACK_MODE_DC || mode==TRACK_MODE_DCX)
|
if (mode==TRACK_MODE_DC || mode==TRACK_MODE_DCX) {
|
||||||
&& !track[trackToSet]->brakeCanPWM()) {
|
#if defined(ARDUINO_AVR_UNO)
|
||||||
|
DIAG(F("Uno has no PWM timers available for DC"));
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
if (!track[trackToSet]->brakeCanPWM()) {
|
||||||
DIAG(F("Brake pin can't PWM: No DC"));
|
DIAG(F("Brake pin can't PWM: No DC"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef ARDUINO_ARCH_ESP32
|
#ifdef ARDUINO_ARCH_ESP32
|
||||||
// remove pin from MUX matrix and turn it off
|
// remove pin from MUX matrix and turn it off
|
||||||
|
|
Loading…
Reference in New Issue
Block a user