From 39c1e3aba23b308e871501f4a105a1ccd7cb495d Mon Sep 17 00:00:00 2001 From: Pierre-noel Bouteville Date: Mon, 30 May 2016 11:58:22 -0600 Subject: [PATCH] Allow to not use all channet in a lower part of PWM --- arch/arm/src/stm32/stm32_pwm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm/src/stm32/stm32_pwm.c b/arch/arm/src/stm32/stm32_pwm.c index 8779d18692..76783804ea 100644 --- a/arch/arm/src/stm32/stm32_pwm.c +++ b/arch/arm/src/stm32/stm32_pwm.c @@ -1314,6 +1314,15 @@ static int pwm_timer(FAR struct stm32_pwmtimer_s *priv, duty = info->channels[i].duty; channel = info->channels[i].channel; + /* A value of zero means to skip this channel */ + + if (channel == 0) + { + continue; + } + + /* Find the channel */ + for (j = 0; j < PWM_NCHANNELS; j++) { if (priv->channels[j].channel == channel)