1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-07-28 18:03:45 +02:00

ESP32 rewrite PWM LEDC to use pin mux

This commit is contained in:
Harald Barth
2024-04-05 01:02:49 +02:00
parent 02bf50b909
commit fdc956576b
5 changed files with 79 additions and 11 deletions

View File

@@ -411,10 +411,10 @@ void MotorDriver::throttleInrush(bool on) {
duty = 255-duty;
#if defined(ARDUINO_ARCH_ESP32)
if(on) {
DCCTimer::DCCEXanalogWrite(brakePin,duty);
DCCTimer::DCCEXanalogWriteFrequency(brakePin, 7); // 7 means max
DCCTimer::DCCEXInrushControlOn(brakePin);
} else {
ledcDetachPin(brakePin);
ledcDetachPin(brakePin); // not DCCTimer::DCCEXledcDetachPin() as we have not
// registered the pin in the pin to channel array
}
#elif defined(ARDUINO_ARCH_STM32)
if(on) {