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 {
|
} else {
|
||||||
// If channel already enabled, only update compare value to avoid glitch
|
// If channel already enabled, only update compare value to avoid glitch
|
||||||
__HAL_TIM_SET_COMPARE(&TimHandle, channel, sConfig.Pulse);
|
__HAL_TIM_SET_COMPARE(&TimHandle, channel, sConfig.Pulse);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(PWMOUT_INVERTED_NOT_SUPPORTED)
|
#if !defined(PWMOUT_INVERTED_NOT_SUPPORTED)
|
||||||
if (obj->inverted) {
|
if (obj->inverted) {
|
||||||
HAL_TIMEx_PWMN_Start(&TimHandle, channel);
|
HAL_TIMEx_PWMN_Start(&TimHandle, channel);
|
||||||
|
|
Loading…
Reference in New Issue