mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-28 10:36:14 +01:00
haba's changes
This commit is contained in:
parent
169050853a
commit
f1aace96d5
|
@ -164,6 +164,12 @@ class MotorDriver {
|
||||||
// otherwise the call from interrupt context can undo whatever we do
|
// otherwise the call from interrupt context can undo whatever we do
|
||||||
// from outside interrupt
|
// from outside interrupt
|
||||||
void setBrake( bool on, bool interruptContext=false);
|
void setBrake( bool on, bool interruptContext=false);
|
||||||
|
#if defined(ARDUINO_GIGA)
|
||||||
|
__attribute__((always_inline)) inline void setSignal( bool high) {
|
||||||
|
digitalWrite(signalPin, high);
|
||||||
|
if (dualSignal) digitalWrite(signalPin2, !high);
|
||||||
|
};
|
||||||
|
#else
|
||||||
__attribute__((always_inline)) inline void setSignal( bool high) {
|
__attribute__((always_inline)) inline void setSignal( bool high) {
|
||||||
if (trackPWM) {
|
if (trackPWM) {
|
||||||
DCCTimer::setPWM(signalPin,high);
|
DCCTimer::setPWM(signalPin,high);
|
||||||
|
@ -179,6 +185,7 @@ class MotorDriver {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
inline void enableSignal(bool on) {
|
inline void enableSignal(bool on) {
|
||||||
if (on)
|
if (on)
|
||||||
pinMode(signalPin, OUTPUT);
|
pinMode(signalPin, OUTPUT);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user