From f581d56bdce137c532607ee5d2368a24de88b4b9 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Fri, 5 Apr 2024 20:30:26 +0200 Subject: [PATCH] ESP32 set frequency after DC speed --- MotorDriver.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MotorDriver.cpp b/MotorDriver.cpp index 8662ca1..66d1b71 100644 --- a/MotorDriver.cpp +++ b/MotorDriver.cpp @@ -347,9 +347,9 @@ void MotorDriver::setDCSignal(byte speedcode, uint8_t frequency /*default =0*/) } } #endif - //DIAG(F("Brake pin %d freqency %d"), brakePin, f); - DCCTimer::DCCEXanalogWriteFrequency(brakePin, f); // set DC PWM frequency + //DIAG(F("Brake pin %d value %d freqency %d"), brakePin, brake, f); DCCTimer::DCCEXanalogWrite(brakePin, brake, invertBrake); + DCCTimer::DCCEXanalogWriteFrequency(brakePin, f); // set DC PWM frequency #else // all AVR here DCCTimer::DCCEXanalogWriteFrequency(brakePin, frequency); // frequency steps analogWrite(brakePin, invertBrake ? 255-brake : brake);