Support indefinite number of pulses generation in PULSECOUNT mode
This commit is contained in:
parent
e35406f7d6
commit
9d355e12d5
@ -509,6 +509,27 @@ static int tiva_pwm_start(FAR struct pwm_lowerhalf_s *dev,
|
||||
chan->inited = true;
|
||||
}
|
||||
|
||||
/* Count 0 means to generate indefinite number of pulses */
|
||||
|
||||
if (info->count == 0)
|
||||
{
|
||||
pwm_expired(chan->handle);
|
||||
|
||||
/* Disable interrupt */
|
||||
|
||||
uint32_t enable = getreg32(chan->controller_base + TIVA_PWM_INTEN_OFFSET);
|
||||
enable &= ~(INT_ENABLE << chan->generator_id);
|
||||
putreg32(enable, chan->controller_base + TIVA_PWM_INTEN_OFFSET);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Enable interrupt */
|
||||
|
||||
uint32_t enable = getreg32(chan->controller_base + TIVA_PWM_INTEN_OFFSET);
|
||||
enable |= (INT_ENABLE << chan->generator_id);
|
||||
putreg32(enable, chan->controller_base + TIVA_PWM_INTEN_OFFSET);
|
||||
}
|
||||
|
||||
/* Start the timer */
|
||||
|
||||
return tiva_pwm_timer(chan, info);
|
||||
@ -818,12 +839,6 @@ FAR struct pwm_lowerhalf_s *tiva_pwm_initialize(int channel)
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Enable interrupt */
|
||||
|
||||
uint32_t enable = getreg32(chan->controller_base + TIVA_PWM_INTEN_OFFSET);
|
||||
enable |= (INT_ENABLE << chan->generator_id);
|
||||
putreg32(enable, chan->controller_base + TIVA_PWM_INTEN_OFFSET);
|
||||
|
||||
#endif
|
||||
|
||||
return (FAR struct pwm_lowerhalf_s *)chan;
|
||||
|
Loading…
x
Reference in New Issue
Block a user