Misc USB device changes reated to SAMA5, trace support, and USB monitoring

This commit is contained in:
Gregory Nutt
2013-09-01 11:52:21 -06:00
parent ad6c760522
commit 8446418f0c
2 changed files with 22 additions and 7 deletions
+14 -7
View File
@@ -46,12 +46,8 @@
#include <errno.h> #include <errno.h>
#include <debug.h> #include <debug.h>
#ifdef CONFIG_SAMA5_SPI0 #ifdef CONFIG_SYSTEM_USBMONITOR
# include <nuttx/spi/spi.h> # include <apps/usbmonitor.h>
# include <nuttx/mtd.h>
# include <nuttx/fs/nxffs.h>
# include "sam_spi.h"
#endif #endif
#include "sama5d3x-ek.h" #include "sama5d3x-ek.h"
@@ -118,7 +114,8 @@
int nsh_archinitialize(void) 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; int ret;
#endif #endif
@@ -168,5 +165,15 @@ int nsh_archinitialize(void)
} }
#endif #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; return OK;
} }
+8
View File
@@ -59,6 +59,7 @@
#define HAVE_AT25_MTD 1 #define HAVE_AT25_MTD 1
#define HAVE_USBHOST 1 #define HAVE_USBHOST 1
#define HAVE_USBDEV 1 #define HAVE_USBDEV 1
#define HAVE_USBMONITOR 1
/* HSMCI */ /* HSMCI */
/* Can't support MMC/SD if the card interface(s) are not enable */ /* Can't support MMC/SD if the card interface(s) are not enable */
@@ -143,6 +144,13 @@
# undef HAVE_USBHOST # undef HAVE_USBHOST
#endif #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 *****************************************************************************/ /* LEDs *****************************************************************************/
/* There are two LEDs on the SAMA5D3 series-CM board that can be controlled /* 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 * by software. A blue LED is controlled via PIO pins. A red LED normally