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

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

commit e7bb97cb5f4287be0193a65b86f5a2ecfe238ee3
Author: raiden00pl <[email protected]>
AuthorDate: Sat Dec 2 18:46:38 2023 +0100

    examples/nxscope: make channel 19 configurable
    
    Channel 19 uses an additional thread to send a text message.
    This commit makes this behaviour configurable.
---
 examples/nxscope/Kconfig        | 4 ++++
 examples/nxscope/nxscope_main.c | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/examples/nxscope/Kconfig b/examples/nxscope/Kconfig
index 7bc3c7802..b29f97f26 100644
--- a/examples/nxscope/Kconfig
+++ b/examples/nxscope/Kconfig
@@ -55,6 +55,10 @@ config EXAMPLES_NXSCOPE_RXBUF_LEN
        int "nxscope RX buffer length"
        default 32
 
+config EXAMPLES_NXSCOPE_CHARLOG
+       bool "nxscope send text message over channel 19"
+       default n
+
 config EXAMPLES_NXSCOPE_CRIBUF_LEN
        int "nxscope critical channels buffer length"
        default 32
diff --git a/examples/nxscope/nxscope_main.c b/examples/nxscope/nxscope_main.c
index 8863b51ed..e10011af4 100644
--- a/examples/nxscope/nxscope_main.c
+++ b/examples/nxscope/nxscope_main.c
@@ -309,6 +309,7 @@ errout:
   return NULL;
 }
 
+#ifdef CONFIG_EXAMPLES_NXSCOPE_CHARLOG
 /****************************************************************************
  * Name: nxscope_charlog_thr
  ****************************************************************************/
@@ -336,6 +337,7 @@ static FAR void *nxscope_charlog_thr(FAR void *arg)
 
   return NULL;
 }
+#endif
 
 #ifdef CONFIG_LOGGING_NXSCOPE_CRICHANNELS
 /****************************************************************************
@@ -621,12 +623,14 @@ int main(int argc, FAR char *argv[])
   u.s.cri   = 0;
   nxscope_chan_init(&nxs, 18, "chan18", u.u8, 0, 4);
 
+#ifdef CONFIG_EXAMPLES_NXSCOPE_CHARLOG
   /* Char channel with metadata */
 
   u.s.dtype = NXSCOPE_TYPE_CHAR;
   u.s._res  = 0;
   u.s.cri   = 0;
   nxscope_chan_init(&nxs, 19, "chan19", u.u8, 64, 4);
+#endif
 
 #ifdef CONFIG_LOGGING_NXSCOPE_CRICHANNELS
   /* Critical channel */
@@ -649,6 +653,7 @@ int main(int argc, FAR char *argv[])
       goto errout;
     }
 
+#ifdef CONFIG_EXAMPLES_NXSCOPE_CHARLOG
   /* Create char log thread */
 
   env.nxs = &nxs;
@@ -658,6 +663,7 @@ int main(int argc, FAR char *argv[])
       printf("ERROR: pthread_create failed %d\n", ret);
       goto errout;
     }
+#endif
 
 #ifdef CONFIG_LOGGING_NXSCOPE_CRICHANNELS
   /* Create critical channel thread */

Reply via email to