arch/stm32: 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:
parent
9620d7a12d
commit
6d346793ee
|
@ -4463,6 +4463,13 @@ static int pwm_stop(struct pwm_lowerhalf_s *dev)
|
|||
outputs = pwm_outputs_from_channels(priv);
|
||||
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);
|
||||
|
||||
pwm_dumpregs(dev, "After stop");
|
||||
|
|
Loading…
Reference in New Issue