summaryrefslogtreecommitdiff
path: root/nuttx/examples/usbstorage
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-10-28 17:21:47 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-10-28 17:21:47 +0000
commita487ac3528bfb932b7c0901287e788097c2cac19 (patch)
tree14b3028007c5538b00ab1e6171f264c402e89cca /nuttx/examples/usbstorage
parentfc5024fb93f5c4454947688625164bb9e7087fac (diff)
downloadpx4-nuttx-a487ac3528bfb932b7c0901287e788097c2cac19.tar.gz
px4-nuttx-a487ac3528bfb932b7c0901287e788097c2cac19.tar.bz2
px4-nuttx-a487ac3528bfb932b7c0901287e788097c2cac19.zip
Add finer trace controls
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1096 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/usbstorage')
-rw-r--r--nuttx/examples/usbstorage/usbstrg_main.c52
1 files changed, 37 insertions, 15 deletions
diff --git a/nuttx/examples/usbstorage/usbstrg_main.c b/nuttx/examples/usbstorage/usbstrg_main.c
index 7e85f991b..6057a73e3 100644
--- a/nuttx/examples/usbstorage/usbstrg_main.c
+++ b/nuttx/examples/usbstorage/usbstrg_main.c
@@ -53,6 +53,42 @@
* Definitions
****************************************************************************/
+#ifdef CONFIG_EXAMPLES_USBSTRG_TRACEINIT
+# define TRACE_INIT_BITS (TRACE_INIT_BIT)
+#else
+# define TRACE_INIT_BITS (0)
+#endif
+
+#define TRACE_ERROR_BITS (TRACE_DEVERROR_BIT|TRACE_CLSERROR_BIT)
+
+#ifdef CONFIG_EXAMPLES_USBSTRG_TRACECLASS
+# define TRACE_CLASS_BITS (TRACE_CLASS_BIT|TRACE_CLASSAPI_BIT|TRACE_CLASSSTATE_BIT)
+#else
+# define TRACE_CLASS_BITS (0)
+#endif
+
+#ifdef CONFIG_EXAMPLES_USBSTRG_TRACETRANSFERS
+# define TRACE_TRANSFER_BITS (TRACE_OUTREQQUEUED_BIT|TRACE_INREQQUEUED_BIT|TRACE_READ_BIT|\
+ TRACE_WRITE_BIT|TRACE_COMPLETE_BIT)
+#else
+# define TRACE_TRANSFER_BITS (0)
+#endif
+
+#ifdef CONFIG_EXAMPLES_USBSTRG_TRACECONTROLLER
+# define TRACE_CONTROLLER_BITS (TRACE_EP_BIT|TRACE_DEV_BIT)
+#else
+# define TRACE_CONTROLLER_BITS (0)
+#endif
+
+#ifdef CONFIG_EXAMPLES_USBSTRG_TRACEINTERRUPTS
+# define TRACE_INTERRUPT_BITS (TRACE_INTENTRY_BIT|TRACE_INTDECODE_BIT|TRACE_INTEXIT_BIT)
+#else
+# define TRACE_INTERRUPT_BITS (0)
+#endif
+
+#define TRACE_BITSET (TRACE_INIT_BITS|TRACE_ERROR_BITS|TRACE_CLASS_BITS|\
+ TRACE_TRANSFER_BITS|TRACE_CONTROLLER_BITS|TRACE_INTERRUPT_BITS)
+
/****************************************************************************
* Private Data
****************************************************************************/
@@ -271,21 +307,7 @@ int user_start(int argc, char *argv[])
/* Initialize USB trace output IDs */
- usbtrace_enable(
- TRACE_INIT_BIT| /* Initialization events */
- TRACE_EP_BIT| /* Endpoint API calls */
- TRACE_DEV_BIT| /* USB device API calls */
- TRACE_CLASS_BIT| /* USB class driver API calls */
- TRACE_CLASSAPI_BIT| /* Other class driver system API calls */
- TRACE_CLASSSTATE_BIT| /* Track class driver state changes */
- TRACE_OUTREQQUEUED_BIT| /* Request queued for OUT endpoint */
- TRACE_INREQQUEUED_BIT| /* Request queued for IN endpoint */
- TRACE_READ_BIT| /* Read (OUT) action */
- TRACE_WRITE_BIT| /* Write (IN) action */
- TRACE_COMPLETE_BIT| /* Request completed */
- TRACE_DEVERROR_BIT| /* USB controller driver error event */
- TRACE_CLSERROR_BIT /* USB class driver error event */
- );
+ usbtrace_enable(TRACE_BITSET);
/* Register block drivers (architecture-specific) */