From 7b77d4ce1e9d679cf703da37ac91221a9f57e54b Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Fri, 5 Apr 2024 14:08:39 +0200 Subject: [PATCH] STM32 fix inverted pin mode --- MotorDriver.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/MotorDriver.cpp b/MotorDriver.cpp index 1ab52d8..8662ca1 100644 --- a/MotorDriver.cpp +++ b/MotorDriver.cpp @@ -413,11 +413,9 @@ void MotorDriver::throttleInrush(bool on) { // registered the pin in the pin to channel array } #elif defined(ARDUINO_ARCH_STM32) - if (invertBrake) - duty = 255-duty; if(on) { DCCTimer::DCCEXanalogWriteFrequency(brakePin, 7); // 7 means max - DCCTimer::DCCEXanalogWrite(brakePin,duty); + DCCTimer::DCCEXanalogWrite(brakePin,duty,invertBrake); } else { pinMode(brakePin, OUTPUT); }