diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-09-01 11:52:21 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-09-01 11:52:21 -0600 |
commit | e24fd9790687a383912a934135e545b605fa4adc (patch) | |
tree | 596ce1fa0ecffd578144ae1fa0f4272962efb3b5 | |
parent | fba28313a862e199e4490e958b573dbef3a32c4a (diff) | |
download | px4-nuttx-e24fd9790687a383912a934135e545b605fa4adc.tar.gz px4-nuttx-e24fd9790687a383912a934135e545b605fa4adc.tar.bz2 px4-nuttx-e24fd9790687a383912a934135e545b605fa4adc.zip |
Misc USB device changes reated to SAMA5, trace support, and USB monitoring
-rw-r--r-- | nuttx/configs/sama5d3x-ek/src/sam_nsh.c | 21 | ||||
-rw-r--r-- | nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h | 8 | ||||
-rw-r--r-- | nuttx/drivers/usbdev/Kconfig | 2 |
3 files changed, 23 insertions, 8 deletions
diff --git a/nuttx/configs/sama5d3x-ek/src/sam_nsh.c b/nuttx/configs/sama5d3x-ek/src/sam_nsh.c index 648a015a6..def866297 100644 --- a/nuttx/configs/sama5d3x-ek/src/sam_nsh.c +++ b/nuttx/configs/sama5d3x-ek/src/sam_nsh.c @@ -46,12 +46,8 @@ #include <errno.h> #include <debug.h> -#ifdef CONFIG_SAMA5_SPI0 -# include <nuttx/spi/spi.h> -# include <nuttx/mtd.h> -# include <nuttx/fs/nxffs.h> - -# include "sam_spi.h" +#ifdef CONFIG_SYSTEM_USBMONITOR +# include <apps/usbmonitor.h> #endif #include "sama5d3x-ek.h" @@ -118,7 +114,8 @@ int nsh_archinitialize(void) { -#if defined(HAVE_AT25_MTD) || defined(HAVE_HSMCI_MTD) || defined(HAVE_USBHOST) +#if defined(HAVE_AT25_MTD) || defined(HAVE_HSMCI_MTD) || defined(HAVE_USBHOST) || \ + defined(HAVE_USBMONITOR) int ret; #endif @@ -168,5 +165,15 @@ int nsh_archinitialize(void) } #endif +#ifdef HAVE_USBMONITOR + /* Start the USB Monitor */ + + ret = usbmonitor_start(0, NULL); + if (ret != OK) + { + message("nsh_archinitialize: Start USB monitor: %d\n", ret); + } +#endif + return OK; } diff --git a/nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h b/nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h index dd77e0f66..dbbba55fd 100644 --- a/nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h +++ b/nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h @@ -59,6 +59,7 @@ #define HAVE_AT25_MTD 1 #define HAVE_USBHOST 1 #define HAVE_USBDEV 1 +#define HAVE_USBMONITOR 1 /* HSMCI */ /* Can't support MMC/SD if the card interface(s) are not enable */ @@ -143,6 +144,13 @@ # undef HAVE_USBHOST #endif +/* Check if we should enable the USB monitor before starting NSH */ + +#if !defined(HAVE_USBDEV) || !defined(CONFIG_USBDEV_TRACE) || \ + !defined(CONFIG_SYSTEM_USBMONITOR) +# undef HAVE_USBMONITOR +#endif + /* LEDs *****************************************************************************/ /* There are two LEDs on the SAMA5D3 series-CM board that can be controlled * by software. A blue LED is controlled via PIO pins. A red LED normally diff --git a/nuttx/drivers/usbdev/Kconfig b/nuttx/drivers/usbdev/Kconfig index dba90e599..ca1d175b2 100644 --- a/nuttx/drivers/usbdev/Kconfig +++ b/nuttx/drivers/usbdev/Kconfig @@ -88,7 +88,7 @@ config USBDEV_TRACE_NRECORDS config USBDEV_TRACE_STRINGS bool "Decode device controller events" default n - depends on USBDEV_TRACE + depends on USBDEV_TRACE || DEBUG_USB ---help--- If USBDEV_TRACE_STRINGS is defined, then the USB device controller driver must provide arrays of strings to support decoding of device- |