1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-26 17:46:14 +01:00

restrict to relevant TRACK_MODE(s)

This commit is contained in:
Harald Barth 2023-07-17 09:42:39 +02:00
parent 94648ead28
commit c2eb5f23b4
2 changed files with 3 additions and 1 deletions

View File

@ -1 +1 @@
#define GITHUB_SHA "devel-202307170030Z" #define GITHUB_SHA "devel-202307170741Z"

View File

@ -350,6 +350,8 @@ void MotorDriver::setDCSignal(byte speedcode) {
void MotorDriver::throttleInrush(bool on) { void MotorDriver::throttleInrush(bool on) {
if (brakePin == UNUSED_PIN) if (brakePin == UNUSED_PIN)
return; return;
if ( !(trackMode & (TRACK_MODE_MAIN | TRACK_MODE_PROG | TRACK_MODE_EXT)))
return;
byte duty = on ? 208 : 0; byte duty = on ? 208 : 0;
if (invertBrake) if (invertBrake)
duty = 255-duty; duty = 255-duty;