diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-11-30 16:52:07 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-11-30 16:52:07 +0000 |
commit | cf595d2b70ae33aa9d758da3846114b7ed658a9f (patch) | |
tree | 53682719347886e4905ecfa84c005010c786d081 /nuttx/configs | |
parent | 3b5628c0580aa974b749806f52e3bc704a4ac744 (diff) | |
download | px4-nuttx-cf595d2b70ae33aa9d758da3846114b7ed658a9f.tar.gz px4-nuttx-cf595d2b70ae33aa9d758da3846114b7ed658a9f.tar.bz2 px4-nuttx-cf595d2b70ae33aa9d758da3846114b7ed658a9f.zip |
Misc USB fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3149 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs')
4 files changed, 20 insertions, 7 deletions
diff --git a/nuttx/configs/nucleus2g/usbstorage/defconfig b/nuttx/configs/nucleus2g/usbstorage/defconfig index fc0aa5f96..b2927cb18 100755 --- a/nuttx/configs/nucleus2g/usbstorage/defconfig +++ b/nuttx/configs/nucleus2g/usbstorage/defconfig @@ -323,7 +323,7 @@ CONFIG_APP_DIR=examples/usbstorage CONFIG_DEBUG=n CONFIG_DEBUG_VERBOSE=n CONFIG_DEBUG_SYMBOLS=n -CONFIG_DDEBUG_USB=n +CONFIG_DEBUG_USB=n CONFIG_MM_REGIONS=2 CONFIG_ARCH_LOWPUTC=y CONFIG_RR_INTERVAL=200 diff --git a/nuttx/configs/olimex-lpc1766stk/src/up_usbstrg.c b/nuttx/configs/olimex-lpc1766stk/src/up_usbstrg.c index c4cacddd3..4d4b1e88e 100755 --- a/nuttx/configs/olimex-lpc1766stk/src/up_usbstrg.c +++ b/nuttx/configs/olimex-lpc1766stk/src/up_usbstrg.c @@ -48,6 +48,9 @@ #include <nuttx/spi.h> #include <nuttx/mmcsd.h> +#include "lpc17_internal.h" +#include "lpc1766stk_internal.h" + /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ @@ -108,6 +111,10 @@ int usbstrg_archinitialize(void) FAR struct spi_dev_s *spi; int ret; + /* Enable power to the SD/MMC via a GPIO. LOW enables SD/MMC. */ + + lpc17_gpiowrite(LPC1766STK_MMC_PWR, false); + /* Get the SPI port */ message("usbstrg_archinitialize: Initializing SPI port %d\n", @@ -118,7 +125,8 @@ int usbstrg_archinitialize(void) { message("usbstrg_archinitialize: Failed to initialize SPI port %d\n", LPC17XX_MMCSDSPIPORTNO); - return -ENODEV; + ret = -ENODEV; + goto errout; } message("usbstrg_archinitialize: Successfully initialized SPI port %d\n", @@ -134,10 +142,15 @@ int usbstrg_archinitialize(void) { message("usbstrg_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO, ret); - return ret; + goto errout; } message("usbstrg_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n", LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO); return OK; -} + + /* Disable power to the SD/MMC via a GPIO. HIGH disables SD/MMC. */ + +errout: + lpc17_gpiowrite(LPC1766STK_MMC_PWR, true); + return ret;} diff --git a/nuttx/configs/olimex-lpc1766stk/usbserial/defconfig b/nuttx/configs/olimex-lpc1766stk/usbserial/defconfig index 175da804e..7262247c2 100755 --- a/nuttx/configs/olimex-lpc1766stk/usbserial/defconfig +++ b/nuttx/configs/olimex-lpc1766stk/usbserial/defconfig @@ -106,7 +106,7 @@ CONFIG_LPC17_BUILDROOT=y CONFIG_LPC17_ETHERNET=n CONFIG_LPC17_USBHOST=n CONFIG_LPC17_USBOTG=n -CONFIG_LPC17_USBDEV=n +CONFIG_LPC17_USBDEV=y CONFIG_LPC17_UART0=y CONFIG_LPC17_UART1=n CONFIG_LPC17_UART2=n diff --git a/nuttx/configs/olimex-lpc1766stk/usbstorage/defconfig b/nuttx/configs/olimex-lpc1766stk/usbstorage/defconfig index d070a247a..0b0e93dda 100755 --- a/nuttx/configs/olimex-lpc1766stk/usbstorage/defconfig +++ b/nuttx/configs/olimex-lpc1766stk/usbstorage/defconfig @@ -106,7 +106,7 @@ CONFIG_LPC17_BUILDROOT=y CONFIG_LPC17_ETHERNET=n CONFIG_LPC17_USBHOST=n CONFIG_LPC17_USBOTG=n -CONFIG_LPC17_USBDEV=n +CONFIG_LPC17_USBDEV=y CONFIG_LPC17_UART0=y CONFIG_LPC17_UART1=n CONFIG_LPC17_UART2=n @@ -324,7 +324,7 @@ CONFIG_APP_DIR=examples/usbstorage CONFIG_DEBUG=n CONFIG_DEBUG_VERBOSE=n CONFIG_DEBUG_SYMBOLS=n -CONFIG_DDEBUG_USB=n +CONFIG_DEBUG_USB=n CONFIG_MM_REGIONS=2 CONFIG_ARCH_LOWPUTC=y CONFIG_RR_INTERVAL=200 |