summaryrefslogtreecommitdiff
path: root/nuttx/configs/stm3210e-eval/src/up_usbstrg.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-07-22 20:12:50 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-07-22 20:12:50 +0000
commite3ba485a852fc10a85533d0c5a28c6e01d66a0d4 (patch)
treea33615148a3516b8d3b14be981e78fc49fa215c5 /nuttx/configs/stm3210e-eval/src/up_usbstrg.c
parent2d333142924f4e7396de449189e2fa383f29248f (diff)
downloadpx4-nuttx-e3ba485a852fc10a85533d0c5a28c6e01d66a0d4.tar.gz
px4-nuttx-e3ba485a852fc10a85533d0c5a28c6e01d66a0d4.tar.bz2
px4-nuttx-e3ba485a852fc10a85533d0c5a28c6e01d66a0d4.zip
apps/examples/usbstorage can now be built as NSH built-in commands; configs/stm3210e-eval/nsh2 now uses these usb storage commands
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3812 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/stm3210e-eval/src/up_usbstrg.c')
-rwxr-xr-xnuttx/configs/stm3210e-eval/src/up_usbstrg.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/nuttx/configs/stm3210e-eval/src/up_usbstrg.c b/nuttx/configs/stm3210e-eval/src/up_usbstrg.c
index add9a7ed9..f7ba205cc 100755
--- a/nuttx/configs/stm3210e-eval/src/up_usbstrg.c
+++ b/nuttx/configs/stm3210e-eval/src/up_usbstrg.c
@@ -1,7 +1,7 @@
/****************************************************************************
* configs/stm3210e-eval/src/up_usbstrg.c
*
- * Copyright (C) 2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Configure and register the STM32 MMC/SD SDIO block driver.
@@ -50,6 +50,8 @@
#include "stm32_internal.h"
+/* There is nothing to do here if SDIO support is not selected. */
+
#ifdef CONFIG_STM32_SDIO
/****************************************************************************
@@ -107,6 +109,12 @@
int usbstrg_archinitialize(void)
{
+ /* If examples/usbstrg is built as an NSH command, then SD slot should
+ * already have been initized in nsh_archinitialize() (see up_nsh.c). In
+ * this case, there is nothing further to be done here.
+ */
+
+#ifndef CONFIG_EXAMPLES_USBSTRG_BUILTIN
FAR struct sdio_dev_s *sdio;
int ret;
@@ -124,7 +132,7 @@ int usbstrg_archinitialize(void)
return -ENODEV;
}
- /* Now bind the SPI interface to the MMC/SD driver */
+ /* Now bind the SDIO interface to the MMC/SD driver */
message("usbstrg_archinitialize: "
"Bind SDIO to the MMC/SD driver, minor=%d\n",
@@ -147,6 +155,9 @@ int usbstrg_archinitialize(void)
*/
sdio_mediachange(sdio, true);
+
+#endif /* CONFIG_EXAMPLES_USBSTRG_BUILTIN */
+
return OK;
}