diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-11-06 07:09:00 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-11-06 07:09:00 -0600 |
commit | 2bfd17c0a201e72a9463c06169d5eaa8bcf277a3 (patch) | |
tree | 05fdfe55698ba1b70da514d3a3b4cc650ee00749 | |
parent | b8766f8e5d5ddd2523c4ad8fdbf83ab93ced2c79 (diff) | |
download | nuttx-2bfd17c0a201e72a9463c06169d5eaa8bcf277a3.tar.gz nuttx-2bfd17c0a201e72a9463c06169d5eaa8bcf277a3.tar.bz2 nuttx-2bfd17c0a201e72a9463c06169d5eaa8bcf277a3.zip |
NSH library: Allow USB trace without a USB console
-rw-r--r-- | apps/ChangeLog.txt | 3 | ||||
-rw-r--r-- | apps/nshlib/nsh.h | 67 | ||||
-rw-r--r-- | nuttx/arch/arm/src/sama5/chip/sam_pwm.h | 3 | ||||
-rw-r--r-- | nuttx/configs/spark/src/up_composite.c | 2 |
4 files changed, 41 insertions, 34 deletions
diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index b0e907092..935ef9ef1 100644 --- a/apps/ChangeLog.txt +++ b/apps/ChangeLog.txt @@ -726,3 +726,6 @@ data drriver from Ken Pettit (2013-11-4). * apps/platform/mikroe-stm32f4: Updated to use new MTD configuration driver features. From Ken Pettit (2013-11-1). + * apps/nshlib/nsh.h: Allow USB trace wihtout a USB console. From + David Sidrane (2013-11-06). + diff --git a/apps/nshlib/nsh.h b/apps/nshlib/nsh.h index a274c9a1f..1d89af3aa 100644 --- a/apps/nshlib/nsh.h +++ b/apps/nshlib/nsh.h @@ -128,55 +128,56 @@ # define CONFIG_NSH_USBCONDEV "/dev/console" # endif +#endif /* HAVE_USB_CONSOLE */ + /* USB trace settings */ -# ifndef CONFIG_USBDEV_TRACE -# undef CONFIG_NSH_USBDEV_TRACE -# endif +#ifndef CONFIG_USBDEV_TRACE +# undef CONFIG_NSH_USBDEV_TRACE +#endif -# ifdef CONFIG_NSH_USBDEV_TRACE -# ifdef CONFIG_NSH_USBDEV_TRACEINIT -# define TRACE_INIT_BITS (TRACE_INIT_BIT) -# else -# define TRACE_INIT_BITS (0) -# endif +#ifdef CONFIG_NSH_USBDEV_TRACE +# 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) +# 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|\ +# 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 +# else +# define TRACE_CLASS_BITS (0) +# endif -# ifdef CONFIG_NSH_USBDEV_TRACETRANSFERS -# define TRACE_TRANSFER_BITS (TRACE_OUTREQQUEUED_BIT|TRACE_INREQQUEUED_BIT|\ +# 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 +# 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_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|\ +# 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 +# else +# define TRACE_INTERRUPT_BITS (0) +# endif -# define TRACE_BITSET (TRACE_INIT_BITS|TRACE_ERROR_BITS|\ +# define TRACE_BITSET (TRACE_INIT_BITS|TRACE_ERROR_BITS|\ TRACE_CLASS_BITS|TRACE_TRANSFER_BITS|\ TRACE_CONTROLLER_BITS|TRACE_INTERRUPT_BITS) -# endif /* CONFIG_NSH_USBDEV_TRACE */ -#endif /* HAVE_USB_CONSOLE */ +#endif /* CONFIG_NSH_USBDEV_TRACE */ /* If Telnet is selected for the NSH console, then we must configure * the resources used by the Telnet daemon and by the Telnet clients. diff --git a/nuttx/arch/arm/src/sama5/chip/sam_pwm.h b/nuttx/arch/arm/src/sama5/chip/sam_pwm.h index 3d4dc98a0..5e3c09827 100644 --- a/nuttx/arch/arm/src/sama5/chip/sam_pwm.h +++ b/nuttx/arch/arm/src/sama5/chip/sam_pwm.h @@ -46,6 +46,9 @@ /************************************************************************************ * Pre-processor Definitions ************************************************************************************/ + +#define SAM_PWM_NCHANNELS 4 /* Four channels numbered 0..3 */ + /* PWM Register Offsets *************************************************************/ #define SAM_PWM_CLK_OFFSET 0x0000 /* PWM Clock Register */ diff --git a/nuttx/configs/spark/src/up_composite.c b/nuttx/configs/spark/src/up_composite.c index 0c7a2ee96..8cb347057 100644 --- a/nuttx/configs/spark/src/up_composite.c +++ b/nuttx/configs/spark/src/up_composite.c @@ -310,7 +310,7 @@ static int do_composite_archinitialize(void) int composite_archinitialize(void) { -#if defined(CONFIG_NSH_ARCHINIT) +#if defined(CONFIG_NSH_ARCHINIT) && defined(CONFIG_NSH_BUILTIN_APPS) return OK; #else return do_composite_archinitialize(); |