1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-23 08:06:13 +01:00

STM32 fix inverted pin mode

This commit is contained in:
Harald Barth 2024-04-05 14:08:39 +02:00
parent d367f5dc81
commit 7b77d4ce1e

View File

@ -413,11 +413,9 @@ void MotorDriver::throttleInrush(bool on) {
// registered the pin in the pin to channel array // registered the pin in the pin to channel array
} }
#elif defined(ARDUINO_ARCH_STM32) #elif defined(ARDUINO_ARCH_STM32)
if (invertBrake)
duty = 255-duty;
if(on) { if(on) {
DCCTimer::DCCEXanalogWriteFrequency(brakePin, 7); // 7 means max DCCTimer::DCCEXanalogWriteFrequency(brakePin, 7); // 7 means max
DCCTimer::DCCEXanalogWrite(brakePin,duty); DCCTimer::DCCEXanalogWrite(brakePin,duty,invertBrake);
} else { } else {
pinMode(brakePin, OUTPUT); pinMode(brakePin, OUTPUT);
} }