Skip to content

Commit

Permalink
arch/stm32f7: Clear all PWM channel when during STOP
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
acassis committed Feb 15, 2024
1 parent f631ffb commit b535740
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arch/arm/src/stm32f7/stm32_pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -4007,6 +4007,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");
Expand Down

0 comments on commit b535740

Please sign in to comment.