mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #13222 from jeromecoutant/PR_PWM
STM32 PWM : avoid glitch after duty cycle changepull/13227/head
commit
3400ef66e7
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue