xiaoxiang781216 commented on code in PR #3633:
URL: https://github.com/apache/nuttx-apps/pull/3633#discussion_r3565431739


##########
examples/audio_rttl/audio_rttl_main.c:
##########
@@ -0,0 +1,305 @@
+/****************************************************************************
+ * apps/examples/audio_rttl/audio_rttl_main.c
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <fcntl.h>
+#include <getopt.h>
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <sys/ioctl.h>
+
+#ifdef CONFIG_PWM
+#include <nuttx/timers/pwm.h>
+#endif
+
+#include <audioutils/rtttl.h>
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct player_s
+{
+  void (*play)(struct rtttl_tone); /* Play RTTTL sound function */
+  void (*teardown)(void);          /* Clean-up function */
+  void *arg;                       /* Private data for functions */
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/* Default song if none was passed. Otherwise, used as buffer for reading
+ * from a file.
+ */
+
+char g_default_song[CONFIG_EXAMPLES_AUDIO_SOUND_MAXLEN] =

Review Comment:
   ```suggestion
   static char g_default_song[CONFIG_EXAMPLES_AUDIO_SOUND_MAXLEN] =
   ```



##########
examples/audio_rttl/audio_rttl_main.c:
##########
@@ -0,0 +1,305 @@
+/****************************************************************************
+ * apps/examples/audio_rttl/audio_rttl_main.c
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <fcntl.h>
+#include <getopt.h>
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <sys/ioctl.h>
+
+#ifdef CONFIG_PWM
+#include <nuttx/timers/pwm.h>
+#endif
+
+#include <audioutils/rtttl.h>
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct player_s
+{
+  void (*play)(struct rtttl_tone); /* Play RTTTL sound function */
+  void (*teardown)(void);          /* Clean-up function */
+  void *arg;                       /* Private data for functions */
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/* Default song if none was passed. Otherwise, used as buffer for reading
+ * from a file.
+ */
+
+char g_default_song[CONFIG_EXAMPLES_AUDIO_SOUND_MAXLEN] =
+    "Test:d=4,o=6,b=90:c,c#,d,d#,e,f,f#,g,a,a#,b,p,b,a#,a,g," \
+    "f#,f,e,d#,d,c#,c";
+
+/* The selected player is a global variable so it can be accessed from within
+ * the player functions properly.
+ */
+
+static struct player_s g_player;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: play_default
+ *
+ * Description:
+ *   The default player choice; prints an error and exits.
+ *
+ * Input Parameters:
+ *   sound - The sound to play
+ *
+ ****************************************************************************/
+
+static void play_default(struct rtttl_tone sound)
+{
+  fprintf(stderr, "No player selected!\n");
+  return;
+}
+
+/****************************************************************************
+ * Name: teardown_default
+ *
+ * Description:
+ *   Default tear-down function. Does nothing.
+ *
+ ****************************************************************************/
+
+static void teardown_default(void)
+{
+  /* No-op */
+
+  return;

Review Comment:
   remove



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to