summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-11-30 15:52:06 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-11-30 15:52:06 +0000
commitf4c3681f580f1b1e389b4341c0638d2b498e395a (patch)
treebc40a383bf9db09bc4cf8ba7793f134fd0527e74
parent967c565a3b4513c66c1ca59e3f13003a97645e22 (diff)
downloadnuttx-f4c3681f580f1b1e389b4341c0638d2b498e395a.tar.gz
nuttx-f4c3681f580f1b1e389b4341c0638d2b498e395a.tar.bz2
nuttx-f4c3681f580f1b1e389b4341c0638d2b498e395a.zip
Move LPC-specific code from examples/usbstorage to mcu123-lpc214x/src
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2290 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c2
-rw-r--r--nuttx/configs/mcu123-lpc214x/src/Makefile4
-rwxr-xr-x[-rw-r--r--]nuttx/configs/mcu123-lpc214x/src/up_usbstrg.c (renamed from nuttx/examples/usbstorage/usbstrg_lpc214x.c)31
-rwxr-xr-xnuttx/configs/stm3210e-eval/README.txt5
-rw-r--r--nuttx/examples/usbstorage/Makefile4
-rw-r--r--nuttx/examples/usbstorage/usbstrg.h11
-rw-r--r--nuttx/examples/usbstorage/usbstrg_main.c2
-rw-r--r--nuttx/include/nuttx/usbdev.h1
8 files changed, 48 insertions, 12 deletions
diff --git a/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c b/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c
index ddd03fc90..2bee48e66 100644
--- a/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c
+++ b/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c
@@ -1,7 +1,7 @@
/*******************************************************************************
* arch/arm/src/lpc214x/lpc214x_usbdev.c
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
diff --git a/nuttx/configs/mcu123-lpc214x/src/Makefile b/nuttx/configs/mcu123-lpc214x/src/Makefile
index ab71e0cce..aad225d08 100644
--- a/nuttx/configs/mcu123-lpc214x/src/Makefile
+++ b/nuttx/configs/mcu123-lpc214x/src/Makefile
@@ -51,6 +51,10 @@ CSRCS = up_spi.c up_leds.c
ifeq ($(CONFIG_EXAMPLES_NSH_ARCHINIT),y)
CSRCS += up_nsh.c
endif
+ifeq ($(CONFIG_EXAMPLE),usbstorage)
+CSRCS += up_usbstrg.c
+endif
+
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
diff --git a/nuttx/examples/usbstorage/usbstrg_lpc214x.c b/nuttx/configs/mcu123-lpc214x/src/up_usbstrg.c
index aea0f0ae5..aab15f13a 100644..100755
--- a/nuttx/examples/usbstorage/usbstrg_lpc214x.c
+++ b/nuttx/configs/mcu123-lpc214x/src/up_usbstrg.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * examples/usbstorage/usbstrg_lpc214x.c
+ * configs/mcu123-lpc214x/src/up_usbstrg.c
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Configure and register the LPC214x MMC/SD SPI block driver.
@@ -49,14 +49,16 @@
#include <nuttx/spi.h>
#include <nuttx/mmcsd.h>
-#include "usbstrg.h"
-
/****************************************************************************
* Pre-Processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
+#ifndef CONFIG_EXAMPLES_USBSTRG_DEVMINOR1
+# define CONFIG_EXAMPLES_USBSTRG_DEVMINOR1 0
+#endif
+
/* PORT and SLOT number probably depend on the board configuration */
#ifdef CONFIG_ARCH_BOARD_MCU123
@@ -69,6 +71,27 @@
# error "Unrecognized LPC214x board"
#endif
+/* Debug ********************************************************************/
+
+#ifdef CONFIG_CPP_HAVE_VARARGS
+# ifdef CONFIG_DEBUG
+# define message(...) lib_lowprintf(__VA_ARGS__)
+# define msgflush()
+# else
+# define message(...) printf(__VA_ARGS__)
+# define msgflush() fflush(stdout)
+# endif
+#else
+# ifdef CONFIG_DEBUG
+# define message lib_lowprintf
+# define msgflush()
+# else
+# define message printf
+# define msgflush() fflush(stdout)
+# endif
+#endif
+
+
/****************************************************************************
* Public Functions
****************************************************************************/
diff --git a/nuttx/configs/stm3210e-eval/README.txt b/nuttx/configs/stm3210e-eval/README.txt
index 6c4b157c1..e6c55b332 100755
--- a/nuttx/configs/stm3210e-eval/README.txt
+++ b/nuttx/configs/stm3210e-eval/README.txt
@@ -418,3 +418,8 @@ Where <subdir> is one of the following:
This configuration directory exercises the USB serial class
driver at examples/usbserial. See examples/README.txt for
more information.
+
+ usbstorage:
+ This configuration directory exercises the USB mass storage
+ class driver at examples/usbstorage. See examples/README.txt for
+ more information.
diff --git a/nuttx/examples/usbstorage/Makefile b/nuttx/examples/usbstorage/Makefile
index 3ba5aadf6..43bd4d4e6 100644
--- a/nuttx/examples/usbstorage/Makefile
+++ b/nuttx/examples/usbstorage/Makefile
@@ -39,10 +39,6 @@
ASRCS =
CSRCS = usbstrg_main.c
-ifeq ($(CONFIG_ARCH_CHIP),lpc214x)
-CSRCS += usbstrg_lpc214x.c
-endif
-
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
diff --git a/nuttx/examples/usbstorage/usbstrg.h b/nuttx/examples/usbstorage/usbstrg.h
index acbf5733f..9cf7af9d5 100644
--- a/nuttx/examples/usbstorage/usbstrg.h
+++ b/nuttx/examples/usbstorage/usbstrg.h
@@ -1,7 +1,7 @@
/****************************************************************************
* examples/usbstorage/usbstrg.h
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -33,6 +33,9 @@
*
****************************************************************************/
+#ifndef __EXAMPLES_USBSTORAGE_USBSTRG_H
+#define __EXAMPLES_USBSTORAGE_USBSTRG_H
+
/****************************************************************************
* Included Files
****************************************************************************/
@@ -106,8 +109,12 @@
* Name: usbstrg_archinitialize
*
* Description:
- * Perform architecture specific initialization
+ * Perform architecture specific initialization. This function must
+ * configure the block device to export via USB. This function must be
+ * provided by architecture-specific logic in order to use this example.
*
****************************************************************************/
extern int usbstrg_archinitialize(void);
+
+#endif /* __EXAMPLES_USBSTORAGE_USBSTRG_H */
diff --git a/nuttx/examples/usbstorage/usbstrg_main.c b/nuttx/examples/usbstorage/usbstrg_main.c
index 6057a73e3..61f546b24 100644
--- a/nuttx/examples/usbstorage/usbstrg_main.c
+++ b/nuttx/examples/usbstorage/usbstrg_main.c
@@ -1,7 +1,7 @@
/****************************************************************************
* examples/usbstorage/usbstrg_main.c
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
diff --git a/nuttx/include/nuttx/usbdev.h b/nuttx/include/nuttx/usbdev.h
index 9cfb74350..2073297d3 100644
--- a/nuttx/include/nuttx/usbdev.h
+++ b/nuttx/include/nuttx/usbdev.h
@@ -278,6 +278,7 @@ struct usbdev_s
/* USB Device Class Implementations *************************************************/
+struct usbdevclass_driver_s;
struct usbdevclass_driverops_s
{
int (*bind)(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver_s *driver);