diff --git a/src/shared/drivers/timer/CountedPWM.cpp b/src/shared/drivers/timer/CountedPWM.cpp index 9187f92bc83c3619e5e822e85a665aa8e1cb1275..f5cc4f8c62a8942ae859891a264a95ce7e756256 100644 --- a/src/shared/drivers/timer/CountedPWM.cpp +++ b/src/shared/drivers/timer/CountedPWM.cpp @@ -85,8 +85,8 @@ void CountedPWM::setDutyCycleResolution(unsigned int dutyCycleResolution) void CountedPWM::generatePulses(uint16_t pulses) { - // Reset the counters - pulseTimer.setCounter(0); + // Reset only the counter timer so that the pulses are generated always with + // the correct frequency and duty cycle counterTimer.setCounter(0); // Set the capture and compare register to the number of pulses to generate