Skip to content
Snippets Groups Projects
Commit a8964c52 authored by schneider's avatar schneider
Browse files

chore(bootloader): Clean up headers and dead code

parent a0704d9c
No related branches found
No related tags found
No related merge requests found
......@@ -35,12 +35,7 @@
*/
/**
* @file main.c
* @brief USB Mass Storage Class example
* @details This project creates a mass storage device using either on-board RAM or
* external SPI flash memory. Load the project, connect a cable from the PC
* to the USB connector. A new external drive should appear than can be read
* and written.
* @brief USB Mass Storage Class
*/
#include <stdio.h>
......
/*******************************************************************************
* Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of Maxim Integrated
* Products, Inc. shall not be used except as stated in the Maxim Integrated
* Products, Inc. Branding Policy.
*
* The mere transfer of this software does not imply any licenses
* of trade secrets, proprietary technology, copyrights, patents,
* trademarks, maskwork rights, or any other form of intellectual
* property whatsoever. Maxim Integrated Products, Inc. retains all
* ownership rights.
*
* $Id: main.c 31505 2017-10-20 21:16:29Z zach.metzinger $
*
*******************************************************************************
*/
/**
* @file main.c
* @brief USB Mass Storage Class example
* @details This project creates a mass storage device using either on-board RAM or
* external SPI flash memory. Load the project, connect a cable from the PC
* to the USB connector. A new external drive should appear than can be read
* and written.
*/
#include <stdio.h>
#include <stddef.h>
#include <stdbool.h>
......@@ -69,7 +24,8 @@
//#define PARTITION_END (0x10000000 + 1024 * 1024 - 1)
extern void run_usbmsc(void);
DIR dir; /* Directory object */
DIR dir;
FATFS FatFs;
bool mount(void)
......@@ -156,7 +112,6 @@ bool is_update_needed(void)
f_close(&file);
//different = true;
return different;
}
......@@ -204,30 +159,6 @@ void flash_partition(void)
f_close(&file);
}
#if 0
void test(void)
{
FRESULT res;
FIL file;
UINT readbytes;
char *filename = "card10.bin";
int len = 512;
char data[512];
res=f_open(&file, filename, FA_OPEN_EXISTING|FA_READ);
if(res != FR_OK) printf("f_open error %d\n", res);
res = f_read(&file, data, len, &readbytes);
if(res != FR_OK) printf("f_read error %d\n", res);
f_close(&file);
data[readbytes] = 0;
printf("data: %s\n", data);
}
#endif
static inline void boot(const void * vtable){
SCB->VTOR = (uintptr_t) vtable;
......
/*******************************************************************************
* Copyright (C) 2017 Maxim Integrated Products, Inc., All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of Maxim Integrated
* Products, Inc. shall not be used except as stated in the Maxim Integrated
* Products, Inc. Branding Policy.
*
* The mere transfer of this software does not imply any licenses
* of trade secrets, proprietary technology, copyrights, patents,
* trademarks, maskwork rights, or any other form of intellectual
* property whatsoever. Maxim Integrated Products, Inc. retains all
* ownership rights.
*
* Description: Communications Device Class ACM (Serial Port) over USB
* $Id: descriptors.h 31172 2017-10-05 19:05:57Z zach.metzinger $
*
*******************************************************************************
*/
/**
* @file mscmem.h
* @brief Memory routines used by the USB Mass Storage Class example.
* See the msc_mem_t structure in msc.h for function details.
* @details Functions are provided for using the internal RAM of the
* device or the external SPI flash memory. Use the SPIXF_DISK
* and RAM_DISK defines to select the desired memory at compile
* time.
*/
#include "mscmem.h"
#include <string.h>
#include <stdio.h>
#include "mx25lba.h"
/***** Definitions *****/
/***** Global Data *****/
/***** File Scope Variables *****/
//static int initialized = 0;
//static int running = 0;
/******************************************************************************/
int mscmem_init()
{
......
......@@ -34,21 +34,18 @@
*
*******************************************************************************
*/
/**
* @file mscmem.h
* @brief Memory routines used by the USB Mass Storage Class example.
* @brief Memory routines used by the USB Mass Storage Class example.
* See the msc_mem_t structure in msc.h for function details.
*/
#ifndef __MSC_MEM_H__
#define __MSC_MEM_H__
#include <stdint.h>
#define ERASE_MEMORY_ON_INIT 1 /* Configuration option to clear the memory (to 0s) on initialization. */
/* Use 1 to clear or 0 to leave untouched. */
int mscmem_init(void);
int mscmem_start(void);
int mscmem_stop(void);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment