These are the examples provided for [[/users/frank26080115/libraries/LPC1700CMSIS_Lib/]] Note, the entire "program" is not compilable!

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers memory.c Source File

memory.c

00001 /*----------------------------------------------------------------------------
00002  *      Name:    MEMORY.C
00003  *      Purpose: USB Mass Storage Demo
00004  *      Version: V1.10
00005  *----------------------------------------------------------------------------
00006  *      This software is supplied "AS IS" without any warranties, express,
00007  *      implied or statutory, including but not limited to the implied
00008  *      warranties of fitness for purpose, satisfactory quality and
00009  *      noninfringement. Keil extends you a royalty-free right to reproduce
00010  *      and distribute executable files created using this software for use
00011  *      on NXP Semiconductors LPC family microcontroller devices only. Nothing
00012  *      else gives you the right to use this software.
00013  *
00014  *      Copyright (c) 2005-2009 Keil Software.
00015  *---------------------------------------------------------------------------*/
00016 
00017 #include "LPC17xx.h"
00018 
00019 #include "lpc_types.h"
00020 
00021 #include "usb.h"
00022 #include "usbcfg.h"
00023 #include "usbhw.h"
00024 #include "usbcore.h"
00025 #include "mscuser.h"
00026 
00027 #include "memory.h"
00028 
00029 #include "lpc17xx_libcfg.h"
00030 #include "lpc17xx_nvic.h"
00031 
00032 /* Example group ----------------------------------------------------------- */
00033 /** @defgroup USBDEV_USBMassStorage USBMassStorage
00034  * @ingroup USBDEV_Examples
00035  * @{
00036  */
00037 
00038 extern uint8_t Memory[MSC_MemorySize];         /* MSC Memory in RAM */
00039 
00040 
00041 /* Main Program */
00042 
00043 int main (void) {
00044     uint32_t n;
00045 
00046     for (n = 0; n < MSC_ImageSize; n++) {     /* Copy Initial Disk Image */
00047         Memory[n] = DiskImage[n];               /*   from Flash to RAM     */
00048     }
00049 
00050     USB_Init();                               /* USB Initialization */
00051     USB_Connect(TRUE);                        /* USB Connect */
00052 
00053     while (1);                                /* Loop forever */
00054 }
00055 
00056 #ifdef  DEBUG
00057 /*******************************************************************************
00058 * @brief        Reports the name of the source file and the source line number
00059 *               where the CHECK_PARAM error has occurred.
00060 * @param[in]    file Pointer to the source file name
00061 * @param[in]    line assert_param error line source number
00062 * @return       None
00063 *******************************************************************************/
00064 void check_failed(uint8_t *file, uint32_t line)
00065 {
00066     /* User can add his own implementation to report the file name and line number,
00067      ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
00068 
00069     /* Infinite loop */
00070     while(1);
00071 }
00072 #endif
00073 
00074 /*
00075  * @}
00076  */