Misc USB fixes

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3149 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2010-11-30 16:52:07 +00:00
parent cc1e0f4555
commit 5ad725c1ca
4 changed files with 20 additions and 7 deletions

View File

@ -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

View File

@ -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;}

View File

@ -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

View File

@ -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