Merge pull request #13222 from jeromecoutant/PR_PWM

STM32 PWM : avoid glitch after duty cycle change
pull/13227/head
Martin Kojtal 2020-07-03 10:51:19 +02:00 committed by GitHub
commit 3400ef66e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -276,7 +276,9 @@ void pwmout_write(pwmout_t *obj, float value)
} else {
// If channel already enabled, only update compare value to avoid glitch
__HAL_TIM_SET_COMPARE(&TimHandle, channel, sConfig.Pulse);
return;
}
#if !defined(PWMOUT_INVERTED_NOT_SUPPORTED)
if (obj->inverted) {
HAL_TIMEx_PWMN_Start(&TimHandle, channel);