diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-05-26 18:05:26 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-05-26 18:05:26 +0000 |
commit | 516a0a7adbb3a71bc846f9e58511082fb83d436c (patch) | |
tree | 79d45d0fafaa9a0386e6c52ebcef2fc2d09233d4 /apps/nshlib/nsh.h | |
parent | 7b37a5a7ba3509ed34c7ceb7c6babf826dd8de6a (diff) | |
download | px4-firmware-516a0a7adbb3a71bc846f9e58511082fb83d436c.tar.gz px4-firmware-516a0a7adbb3a71bc846f9e58511082fb83d436c.tar.bz2 px4-firmware-516a0a7adbb3a71bc846f9e58511082fb83d436c.zip |
Add support for the USB trace cability in NSH when a USB console is used
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4774 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'apps/nshlib/nsh.h')
-rw-r--r-- | apps/nshlib/nsh.h | 53 |
1 files changed, 47 insertions, 6 deletions
diff --git a/apps/nshlib/nsh.h b/apps/nshlib/nsh.h index babdedd91..e31fa20f1 100644 --- a/apps/nshlib/nsh.h +++ b/apps/nshlib/nsh.h @@ -109,17 +109,50 @@ # define CONFIG_NSH_UBSDEV_MINOR 0 # endif -/* USB trace settings */ - -# ifndef CONFIG_NSH_UBSDEV_TRACEINIT -# define CONFIG_NSH_UBSDEV_TRACEINIT (TRACE_DEVERROR_BIT|TRACE_CLSERROR_BIT) -# endif - /* The default console device is always /dev/console */ # ifndef CONFIG_NSH_USBCONDEV # define CONFIG_NSH_USBCONDEV "/dev/console" # endif + +/* USB trace settings */ + +#ifdef CONFIG_NSH_USBDEV_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_NSH_USBDEV_TRACECLASS +# define TRACE_CLASS_BITS (TRACE_CLASS_BIT|TRACE_CLASSAPI_BIT|TRACE_CLASSSTATE_BIT) +#else +# define TRACE_CLASS_BITS (0) +#endif + +#ifdef CONFIG_NSH_USBDEV_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_NSH_USBDEV_TRACECONTROLLER +# define TRACE_CONTROLLER_BITS (TRACE_EP_BIT|TRACE_DEV_BIT) +#else +# define TRACE_CONTROLLER_BITS (0) +#endif + +#ifdef CONFIG_NSH_USBDEV_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) + #endif /* If Telnet is selected for the NSH console, then we must configure @@ -400,6 +433,14 @@ void nsh_freefullpath(char *relpath); void nsh_dumpbuffer(FAR struct nsh_vtbl_s *vtbl, const char *msg, const uint8_t *buffer, ssize_t nbytes); +/* USB debug support */ + +#if defined(CONFIG_USBDEV_TRACE) && defined(HAVE_USB_CONSOLE) +void nsh_usbtrace(void); +#else +# define nsh_usbtrace() +#endif + /* Shell command handlers */ #ifndef CONFIG_NSH_DISABLE_ECHO |