mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 17:48:54 +08:00
tone: stop tone using 0 duty, not stop()
This commit is contained in:
committed by
Abdelatif Guettouche
parent
1115f0104b
commit
b3327419d3
+10
-1
@@ -328,7 +328,16 @@ static void stop_note(FAR struct tone_upperhalf_s *upper)
|
|||||||
{
|
{
|
||||||
FAR struct pwm_lowerhalf_s *tone = upper->devtone;
|
FAR struct pwm_lowerhalf_s *tone = upper->devtone;
|
||||||
|
|
||||||
tone->ops->stop(tone);
|
#ifdef CONFIG_PWM_MULTICHAN
|
||||||
|
upper->tone.channels[0].channel = upper->channel;
|
||||||
|
upper->tone.channels[0].duty = 0;
|
||||||
|
#else
|
||||||
|
upper->tone.duty = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* REVISIT: Should check the return value */
|
||||||
|
|
||||||
|
tone->ops->start(tone, &upper->tone);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user