Allow to not use all channet in a lower part of PWM

This commit is contained in:
Pierre-noel Bouteville 2016-05-30 11:58:22 -06:00 committed by Gregory Nutt
parent 5ef3e3e215
commit 39c1e3aba2
1 changed files with 9 additions and 0 deletions

View File

@ -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)