tmedicci commented on code in PR #2232:
URL: https://github.com/apache/nuttx-apps/pull/2232#discussion_r1430573604


##########
examples/rmtchar/rmtchar_main.c:
##########
@@ -0,0 +1,360 @@
+/****************************************************************************
+ * apps/examples/rmtchar/rmtchar_main.c
+ *
+ * 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 <nuttx/config.h>
+
+#include <sys/types.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <pthread.h>
+#include <errno.h>
+#include <debug.h>
+
+#include "rmtchar.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#if !defined(CONFIG_EXAMPLES_RMTCHAR_RX) && \
+    !defined(CONFIG_EXAMPLES_RMTCHAR_TX)
+#  error "At least one of CONFIG_EXAMPLES_RMTCHAR_RX or \
+          CONFIG_EXAMPLES_RMTCHAR_TX must be defined"
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct rmtchar_state_s g_rmtchar;

Review Comment:
   Because, for testing applications, it's easier to just setup every 
parameters once and rerun when needed (or change only part of the previously 
setup environment). The same is valid for other testing applications, like 
[`adc`](https://github.com/apache/incubator-nuttx-apps/blob/2ac8589a25b5a64b075eb25a3b58e170dac5bcab/examples/adc/adc_main.c#L59),
 
[`dac`](https://github.com/apache/incubator-nuttx-apps/blob/054cf3b1cb2697fc4f1c114a52c030d5a88a6899/examples/dac/dac_main.c#L88),
 
[`pwm`](https://github.com/apache/incubator-nuttx-apps/blob/0a7c308f1b609a5a41f0e8246a528f66f5deb284/examples/pwm/pwm_main.c#L119)
 and 
[`i2schar`](https://github.com/apache/incubator-nuttx-apps/blob/66f957792f3618c3e6fc4f9dede577967228d494/examples/i2schar/i2schar_main.c#L58),
 for instance.



-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to