1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-24 16:46:13 +01:00

haba's changes

This commit is contained in:
travis-farmer 2023-10-22 11:43:48 -04:00
parent 169050853a
commit f1aace96d5

View File

@ -164,6 +164,12 @@ class MotorDriver {
// otherwise the call from interrupt context can undo whatever we do
// from outside interrupt
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) {
if (trackPWM) {
DCCTimer::setPWM(signalPin,high);
@ -179,6 +185,7 @@ class MotorDriver {
}
}
};
#endif
inline void enableSignal(bool on) {
if (on)
pinMode(signalPin, OUTPUT);