1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-07-30 19:03:44 +02:00

Bugfix: Preserve direction all times when switching between DCC and DC

This commit is contained in:
Harald Barth
2022-08-23 07:56:56 +02:00
parent 827e4fef86
commit 86215b28ae
5 changed files with 33 additions and 18 deletions

View File

@@ -121,8 +121,7 @@ class MotorDriver {
// otherwise the call from interrupt context can undo whatever we do
// from outside interrupt
void setBrake( bool on, bool interruptContext=false);
__attribute__((always_inline)) inline void setSignal( bool high, bool interruptContext=false) {
if (!interruptContext) {noInterrupts();}
__attribute__((always_inline)) inline void setSignal( bool high) {
if (trackPWM) {
DCCTimer::setPWM(signalPin,high);
}
@@ -136,7 +135,6 @@ class MotorDriver {
if (dualSignal) setHIGH(fastSignalPin2);
}
}
if (!interruptContext) {interrupts();}
};
inline void enableSignal(bool on) {
if (on)