summaryrefslogtreecommitdiff
path: root/apps/examples/usbstorage
diff options
context:
space:
mode:
Diffstat (limited to 'apps/examples/usbstorage')
-rw-r--r--apps/examples/usbstorage/Kconfig12
-rw-r--r--apps/examples/usbstorage/Makefile2
-rw-r--r--apps/examples/usbstorage/usbmsc.h8
-rw-r--r--apps/examples/usbstorage/usbmsc_main.c14
4 files changed, 16 insertions, 20 deletions
diff --git a/apps/examples/usbstorage/Kconfig b/apps/examples/usbstorage/Kconfig
index 823ae2953..c338ae99e 100644
--- a/apps/examples/usbstorage/Kconfig
+++ b/apps/examples/usbstorage/Kconfig
@@ -9,14 +9,7 @@ config EXAMPLES_USBMSC
---help---
Enable the USB mass storage class example
-config EXAMPLES_USBMSC_BUILTIN
- bool "NSH built-in command"
- default y
- depends on EXAMPLES_USBMSC && NSH_BUILTIN_APPS
- ---help---
- This example can be built as two NSH "built-in" commands if this
- option is selected: 'msconn' will connect the USB mass storage
- device; 'msdis' will disconnect the USB storage device.
+if EXAMPLES_USBMSC
config EXAMPLES_USBMSC_NLUNS
int "Number of LUNs"
@@ -134,3 +127,6 @@ config EXAMPLES_USBMSC_TRACEINTERRUPTS
then the example code will also manage the USB trace output. The
amount of trace output can be controlled this configuration value:
This setting will show USB device controller interrupt-related events.
+
+endif
+
diff --git a/apps/examples/usbstorage/Makefile b/apps/examples/usbstorage/Makefile
index 6c486bf9c..76198efa0 100644
--- a/apps/examples/usbstorage/Makefile
+++ b/apps/examples/usbstorage/Makefile
@@ -87,7 +87,7 @@ $(COBJS): %$(OBJEXT): %.c
$(call ARCHIVE, $(BIN), $(OBJS))
@touch .built
-ifeq ($(CONFIG_EXAMPLES_USBMSC_BUILTIN),y)
+ifeq ($(CONFIG_NSH_BUILTIN_APPS),y)
$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat: $(DEPCONFIG) Makefile
$(call REGISTER,$(APPNAME1),$(PRIORITY1),$(STACKSIZE1),$(APPNAME1)_main)
diff --git a/apps/examples/usbstorage/usbmsc.h b/apps/examples/usbstorage/usbmsc.h
index 95453198a..b3652ab0a 100644
--- a/apps/examples/usbstorage/usbmsc.h
+++ b/apps/examples/usbstorage/usbmsc.h
@@ -109,17 +109,17 @@
* order to avoid name collisions.
*/
-#if defined(CONFIG_EXAMPLES_USBMSC_BUILTIN) || defined(CONFIG_EXAMPLES_USBMSC_DEBUGMM)
+#if defined(CONFIG_NSH_BUILTIN_APPS) || defined(CONFIG_EXAMPLES_USBMSC_DEBUGMM)
struct usbmsc_state_s
{
/* This is the handle that references to this particular USB storage driver
* instance. It is only needed if the USB mass storage device example is
- * built using CONFIG_EXAMPLES_USBMSC_BUILTIN. In this case, the value
+ * built using CONFIG_NSH_BUILTIN_APPS. In this case, the value
* of the driver handle must be remembered between the 'msconn' and 'msdis'
* commands.
*/
-#ifdef CONFIG_EXAMPLES_USBMSC_BUILTIN
+#ifdef CONFIG_NSH_BUILTIN_APPS
FAR void *mshandle;
#endif
@@ -143,7 +143,7 @@ struct usbmsc_state_s
* order to avoid name collisions.
*/
-#if defined(CONFIG_EXAMPLES_USBMSC_BUILTIN) || defined(CONFIG_EXAMPLES_USBMSC_DEBUGMM)
+#if defined(CONFIG_NSH_BUILTIN_APPS) || defined(CONFIG_EXAMPLES_USBMSC_DEBUGMM)
extern struct usbmsc_state_s g_usbmsc;
#endif
diff --git a/apps/examples/usbstorage/usbmsc_main.c b/apps/examples/usbstorage/usbmsc_main.c
index ac7b82d01..5c0ae232e 100644
--- a/apps/examples/usbstorage/usbmsc_main.c
+++ b/apps/examples/usbstorage/usbmsc_main.c
@@ -98,7 +98,7 @@
* order to avoid name collisions.
*/
-#if defined(CONFIG_EXAMPLES_USBMSC_BUILTIN) || defined(CONFIG_EXAMPLES_USBMSC_DEBUGMM)
+#if defined(CONFIG_NSH_BUILTIN_APPS) || defined(CONFIG_EXAMPLES_USBMSC_DEBUGMM)
struct usbmsc_state_s g_usbmsc;
#endif
@@ -383,7 +383,7 @@ static int usbmsc_enumerate(struct usbtrace_s *trace, void *arg)
*
* Description:
* This is the main program that configures the USB mass storage device
- * and exports the LUN(s). If CONFIG_EXAMPLES_USBMSC_BUILTIN is defined
+ * and exports the LUN(s). If CONFIG_NSH_BUILTIN_APPS is defined
* in the NuttX configuration, then this program can be executed by
* entering the "msconn" command at the NSH console.
*
@@ -398,7 +398,7 @@ int msconn_main(int argc, char *argv[])
* do a little error checking to assure that we are not being called re-entrantly.
*/
-#ifdef CONFIG_EXAMPLES_USBMSC_BUILTIN
+#ifdef CONFIG_NSH_BUILTIN_APPS
/* Check if there is a non-NULL USB mass storage device handle (meaning that the
* USB mass storage device is already configured).
@@ -504,7 +504,7 @@ int msconn_main(int argc, char *argv[])
* then we have not real option but to exit now.
*/
-#if !defined(CONFIG_EXAMPLES_USBMSC_BUILTIN) && !defined(CONFIG_DISABLE_SIGNALS)
+#if !defined(CONFIG_NSH_BUILTIN_APPS) && !defined(CONFIG_DISABLE_SIGNALS)
/* Otherwise, this thread will hang around and monitor the USB storage activity */
@@ -527,7 +527,7 @@ int msconn_main(int argc, char *argv[])
message("msconn_main: Still alive\n");
# endif
}
-#elif defined(CONFIG_EXAMPLES_USBMSC_BUILTIN)
+#elif defined(CONFIG_NSH_BUILTIN_APPS)
/* Return the USB mass storage device handle so it can be used by the 'misconn'
* command.
@@ -555,13 +555,13 @@ int msconn_main(int argc, char *argv[])
*
* Description:
* This is a program entry point that will disconnet the USB mass storage
- * device. This program is only available if CONFIG_EXAMPLES_USBMSC_BUILTIN
+ * device. This program is only available if CONFIG_NSH_BUILTIN_APPS
* is defined in the NuttX configuration. In that case, this program can
* be executed by entering the "msdis" command at the NSH console.
*
****************************************************************************/
-#ifdef CONFIG_EXAMPLES_USBMSC_BUILTIN
+#ifdef CONFIG_NSH_BUILTIN_APPS
int msdis_main(int argc, char *argv[])
{
/* First check if the USB mass storage device is already connected */