mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
arch/stm32f7: Clear all PWM channel when during STOP
I noticed when executing pwm STOP command in multichannel mode, the channel still outputting. This commit fixes this issue. Signed-off-by: Alan C. Assis <acassis@gmail.com>
This commit is contained in:
committed by
Xiang Xiao
parent
6d346793ee
commit
5975b25951
@@ -4007,6 +4007,13 @@ static int pwm_stop(struct pwm_lowerhalf_s *dev)
|
|||||||
outputs = pwm_outputs_from_channels(priv);
|
outputs = pwm_outputs_from_channels(priv);
|
||||||
ret = pwm_outputs_enable(dev, outputs, false);
|
ret = pwm_outputs_enable(dev, outputs, false);
|
||||||
|
|
||||||
|
/* Clear all channels */
|
||||||
|
|
||||||
|
pwm_putreg(priv, STM32_GTIM_CCR1_OFFSET, 0);
|
||||||
|
pwm_putreg(priv, STM32_GTIM_CCR2_OFFSET, 0);
|
||||||
|
pwm_putreg(priv, STM32_GTIM_CCR3_OFFSET, 0);
|
||||||
|
pwm_putreg(priv, STM32_GTIM_CCR4_OFFSET, 0);
|
||||||
|
|
||||||
leave_critical_section(flags);
|
leave_critical_section(flags);
|
||||||
|
|
||||||
pwm_dumpregs(dev, "After stop");
|
pwm_dumpregs(dev, "After stop");
|
||||||
|
|||||||
Reference in New Issue
Block a user