From ac4af407aa26b8773d2fc074d641f4dcaf243a15 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Tue, 21 Nov 2023 22:47:48 +0100 Subject: [PATCH] On ESP32, the inversion is already done in HW --- MotorDriver.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MotorDriver.h b/MotorDriver.h index 19bfd13..07ff93f 100644 --- a/MotorDriver.h +++ b/MotorDriver.h @@ -156,8 +156,10 @@ class MotorDriver { // from outside interrupt void setBrake( bool on, bool interruptContext=false); __attribute__((always_inline)) inline void setSignal( bool high) { +#ifndef ARDUINO_ARCH_ESP32 if (invertPhase) high = !high; +#endif if (trackPWM) { DCCTimer::setPWM(signalPin,high); }