diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-09-06 17:21:57 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-09-06 17:21:57 -0600 |
commit | 1a0b7737074845c124b36abc5260e10f6bf416ae (patch) | |
tree | 803c0b177470be16b9c0fa03748d5f43f0710b46 /apps/examples | |
parent | 1797cce6b85bd6ad1e0ecd411c0ed99078fe75c3 (diff) | |
download | nuttx-1a0b7737074845c124b36abc5260e10f6bf416ae.tar.gz nuttx-1a0b7737074845c124b36abc5260e10f6bf416ae.tar.bz2 nuttx-1a0b7737074845c124b36abc5260e10f6bf416ae.zip |
Suppress attempts to manage USB trace if the USB MSC example is built as an NSH built-in application. In that case, USB MSC does not do a good job managing trace data and gets in the way of other things that can do a better job (like NSH or the USB monitor).
Diffstat (limited to 'apps/examples')
-rw-r--r-- | apps/examples/usbmsc/Kconfig | 19 | ||||
-rw-r--r-- | apps/examples/usbmsc/usbmsc_main.c | 8 |
2 files changed, 18 insertions, 9 deletions
diff --git a/apps/examples/usbmsc/Kconfig b/apps/examples/usbmsc/Kconfig index 1681b181f..9940fe482 100644 --- a/apps/examples/usbmsc/Kconfig +++ b/apps/examples/usbmsc/Kconfig @@ -70,10 +70,20 @@ config EXAMPLES_USBMSC_DEBUGMM ---help--- Enables some debug tests to check for memory usage and memory leaks. +config EXAMPLES_USBMSC_TRACE + bool "Trace USB activity" + default n + depends on (USBDEV_TRACE || DEBUG_USB) && !NSH_BUILTIN_APPS + ---help--- + If this example is built as a standalone task and if USB device tracing is + enabled, then this example can be configured to unobtrusively monitor + USB activity by selecting this option. + +if EXAMPLES_USBMSC_TRACE + config EXAMPLES_USBMSC_TRACEINIT bool "USB Trace Initialization" default n - depends on USBDEV_TRACE || DEBUG_USB ---help--- If USBDEV_TRACE is enabled (or DEBUG and DEBUG_USB), then the example code will also manage the USB trace output. The @@ -83,7 +93,6 @@ config EXAMPLES_USBMSC_TRACEINIT config EXAMPLES_USBMSC_TRACECLASS bool "USB Trace Class" default n - depends on USBDEV_TRACE || DEBUG_USB ---help--- If USBDEV_TRACE is enabled (or DEBUG and DEBUG_USB), then the example code will also manage the USB trace output. The @@ -93,7 +102,6 @@ config EXAMPLES_USBMSC_TRACECLASS config EXAMPLES_USBMSC_TRACETRANSFERS bool "USB Trace Transfers" default n - depends on USBDEV_TRACE || DEBUG_USB ---help--- If USBDEV_TRACE is enabled (or DEBUG and DEBUG_USB), then the example code will also manage the USB trace output. The @@ -103,7 +111,6 @@ config EXAMPLES_USBMSC_TRACETRANSFERS config EXAMPLES_USBMSC_TRACECONTROLLER bool "USB Trace Device Controller Events" default n - depends on USBDEV_TRACE || DEBUG_USB ---help--- If USBDEV_TRACE is enabled (or DEBUG and DEBUG_USB), then the example code will also manage the USB trace output. The @@ -113,12 +120,12 @@ config EXAMPLES_USBMSC_TRACECONTROLLER config EXAMPLES_USBMSC_TRACEINTERRUPTS bool "USB Trace Device Controller Interrupt Events" default n - depends on USBDEV_TRACE || DEBUG_USB ---help--- If USBDEV_TRACE is enabled (or DEBUG and DEBUG_USB), then the example code will also manage the USB trace output. The amount of trace output can be controlled this configuration value: This setting will show USB device controller interrupt-related events. -endif +endif # EXAMPLES_USBMSC_TRACE +endif # EXAMPLES_USBMSC diff --git a/apps/examples/usbmsc/usbmsc_main.c b/apps/examples/usbmsc/usbmsc_main.c index 4ff59f9da..95875c423 100644 --- a/apps/examples/usbmsc/usbmsc_main.c +++ b/apps/examples/usbmsc/usbmsc_main.c @@ -196,7 +196,7 @@ static void final_memory_usage(FAR const char *msg) * Name: usbmsc_enumerate ****************************************************************************/ -#ifdef CONFIG_USBDEV_TRACE +#ifdef CONFIG_EXAMPLES_USBMSC_TRACE static int usbmsc_enumerate(struct usbtrace_s *trace, void *arg) { switch (trace->event) @@ -423,8 +423,10 @@ int msconn_main(int argc, char *argv[]) /* Initialize USB trace output IDs */ +#ifdef CONFIG_EXAMPLES_USBMSC_TRACE usbtrace_enable(TRACE_BITSET); check_test_memory_usage("After usbtrace_enable()"); +#endif /* Register block drivers (architecture-specific) */ @@ -513,9 +515,9 @@ int msconn_main(int argc, char *argv[]) msgflush(); sleep(5); -# ifdef CONFIG_USBDEV_TRACE +# ifdef CONFIG_EXAMPLES_USBMSC_TRACE message("\nmsconn_main: USB TRACE DATA:\n"); - ret = usbtrace_enumerate(usbmsc_enumerate, NULL); + ret = usbtrace_enumerate(usbmsc_enumerate, NULL); if (ret < 0) { message("msconn_main: usbtrace_enumerate failed: %d\n", -ret); |