Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marek
firmware
Commits
a8964c52
Commit
a8964c52
authored
5 years ago
by
schneider
Browse files
Options
Downloads
Patches
Plain Diff
chore(bootloader): Clean up headers and dead code
parent
a0704d9c
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
bootloader/bootloader-usb.c
+1
-6
1 addition, 6 deletions
bootloader/bootloader-usb.c
bootloader/main.c
+2
-71
2 additions, 71 deletions
bootloader/main.c
bootloader/mscmem.c
+0
-56
0 additions, 56 deletions
bootloader/mscmem.c
bootloader/mscmem.h
+3
-6
3 additions, 6 deletions
bootloader/mscmem.h
with
6 additions
and
139 deletions
bootloader/bootloader-usb.c
+
1
−
6
View file @
a8964c52
...
...
@@ -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>
...
...
This diff is collapsed.
Click to expand it.
bootloader/main.c
+
2
−
71
View file @
a8964c52
/*******************************************************************************
* 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
;
...
...
This diff is collapsed.
Click to expand it.
bootloader/mscmem.c
+
0
−
56
View file @
a8964c52
/*******************************************************************************
* 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
()
{
...
...
This diff is collapsed.
Click to expand it.
bootloader/mscmem.h
+
3
−
6
View file @
a8964c52
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment