You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/06/25 10:04:24 UTC

[incubator-nuttx] 02/04: tone: start playing tune immediately without delay

This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 10a9464bcf699a1ef1ae21e9312c988ef6428ef1
Author: Matias Nitsche <mn...@dc.uba.ar>
AuthorDate: Sun Jun 21 11:23:33 2020 -0300

    tone: start playing tune immediately without delay
---
 drivers/audio/tone.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/audio/tone.c b/drivers/audio/tone.c
index 843aec6..85411cd 100644
--- a/drivers/audio/tone.c
+++ b/drivers/audio/tone.c
@@ -361,12 +361,9 @@ static void start_tune(FAR struct tone_upperhalf_s *upper, const char *tune)
   g_silence_length = 0;
   g_repeat         = false;
 
-  /* Schedule a callback to start playing */
+  /* Start playing tune */
 
-  ts.tv_sec        = 1;
-  ts.tv_nsec       = 0;
-
-  ONESHOT_START(upper->oneshot, oneshot_callback, upper, &ts);
+  next_note(upper);
 }
 
 /****************************************************************************