Skip to content

Commit

Permalink
STM32 fix inverted pin mode
Browse files Browse the repository at this point in the history
  • Loading branch information
habazut committed Apr 5, 2024
1 parent d367f5d commit 7b77d4c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions MotorDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 7b77d4c

Please sign in to comment.