summaryrefslogtreecommitdiff
path: root/apps/examples/cdcacm/cdcacm.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/examples/cdcacm/cdcacm.h')
-rw-r--r--apps/examples/cdcacm/cdcacm.h42
1 files changed, 41 insertions, 1 deletions
diff --git a/apps/examples/cdcacm/cdcacm.h b/apps/examples/cdcacm/cdcacm.h
index 60eada896..ce40e1a93 100644
--- a/apps/examples/cdcacm/cdcacm.h
+++ b/apps/examples/cdcacm/cdcacm.h
@@ -41,12 +41,14 @@
****************************************************************************/
#include <nuttx/config.h>
+
#include <stdlib.h>
+#include <nuttx/usb/usbdev_trace.h>
+
/****************************************************************************
* Pre-Processor Definitions
****************************************************************************/
-
/* Configuration ************************************************************/
/* Prerequisites */
@@ -68,6 +70,44 @@
# define CONFIG_EXAMPLES_CDCACM_DEVMINOR 0
#endif
+/* Trace Configuration ******************************************************/
+
+#ifdef CONFIG_EXAMPLES_CDCACM_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_CDCACM_TRACECLASS
+# define TRACE_CLASS_BITS (TRACE_CLASS_BIT|TRACE_CLASSAPI_BIT|TRACE_CLASSSTATE_BIT)
+#else
+# define TRACE_CLASS_BITS (0)
+#endif
+
+#ifdef CONFIG_EXAMPLES_CDCACM_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_CDCACM_TRACECONTROLLER
+# define TRACE_CONTROLLER_BITS (TRACE_EP_BIT|TRACE_DEV_BIT)
+#else
+# define TRACE_CONTROLLER_BITS (0)
+#endif
+
+#ifdef CONFIG_EXAMPLES_CDCACM_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)
+
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS