9
0
Fork 0

Move LPC-specific code from examples/usbstorage to mcu123-lpc214x/src

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@2290 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2009-11-30 15:52:06 +00:00
parent 6af87c2d67
commit 89241e34a0
8 changed files with 48 additions and 12 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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