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
a43065c5
Commit
a43065c5
authored
5 years ago
by
schneider
Committed by
rahix
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
feat(bootloader): Show ready/writing message
parent
d681d9de
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
+13
-0
13 additions, 0 deletions
bootloader/bootloader-usb.c
bootloader/main.c
+4
-6
4 additions, 6 deletions
bootloader/main.c
bootloader/mscmem.c
+17
-0
17 additions, 0 deletions
bootloader/mscmem.c
lib/mx25lba/mx25lba.h
+1
-0
1 addition, 0 deletions
lib/mx25lba/mx25lba.h
with
35 additions
and
6 deletions
bootloader/bootloader-usb.c
+
13
−
0
View file @
a43065c5
...
...
@@ -52,6 +52,8 @@
#include
"descriptors.h"
#include
"mscmem.h"
#include
"card10.h"
#include
"display.h"
#include
"GUI_Paint.h"
/***** Definitions *****/
#define EVENT_ENUM_COMP MAXUSB_NUM_EVENTS
...
...
@@ -112,6 +114,17 @@ void delay_us(unsigned int usec)
mxc_delay
(
usec
);
}
void
bootloader_dirty
(
void
)
{
Paint_DrawString_EN
(
0
,
16
*
3
,
"Writing."
,
&
Font16
,
0x0000
,
0xf000
);
LCD_Update
();
}
void
bootloader_clean
(
void
)
{
Paint_DrawString_EN
(
0
,
16
*
3
,
"Ready. "
,
&
Font16
,
0x0000
,
0xffff
);
LCD_Update
();
}
/******************************************************************************/
void
run_usbmsc
(
void
)
{
...
...
This diff is collapsed.
Click to expand it.
bootloader/main.c
+
4
−
6
View file @
a43065c5
...
...
@@ -238,12 +238,10 @@ int main(void)
// If the button is pressed, we go into MSC mode.
if
(
PB_Get
(
3
))
{
Paint_DrawString_EN
(
0
,
16
*
2
,
"USB activated. Waiting."
,
&
Font16
,
0x0000
,
0xffff
0
,
16
*
2
,
"USB activated."
,
&
Font16
,
0x0000
,
0xffff
);
Paint_DrawString_EN
(
0
,
16
*
3
,
"Ready."
,
&
Font16
,
0x0000
,
0xffff
);
LCD_Update
();
run_usbmsc
();
...
...
This diff is collapsed.
Click to expand it.
bootloader/mscmem.c
+
17
−
0
View file @
a43065c5
...
...
@@ -3,6 +3,11 @@
#include
<stdio.h>
#include
"mx25lba.h"
void
bootloader_dirty
(
void
);
void
bootloader_clean
(
void
);
static
int
dirty
=
0
;
/******************************************************************************/
int
mscmem_init
()
{
...
...
@@ -27,6 +32,10 @@ int mscmem_read(uint32_t lba, uint8_t *buffer)
int
mscmem_write
(
uint32_t
lba
,
uint8_t
*
buffer
)
{
//printf("%s\n", __func__);
if
(
dirty
==
0
)
{
bootloader_dirty
();
}
dirty
=
2
;
return
mx25_write
(
lba
,
buffer
);
}
...
...
@@ -48,5 +57,13 @@ int mscmem_stop()
int
mscmem_ready
()
{
//printf("%s\n", __func__);
if
(
dirty
)
{
dirty
--
;
if
(
dirty
==
0
)
{
printf
(
"sync
\n
"
);
mx25_sync
();
bootloader_clean
();
}
}
return
mx25_ready
();
}
This diff is collapsed.
Click to expand it.
lib/mx25lba/mx25lba.h
+
1
−
0
View file @
a43065c5
...
...
@@ -52,5 +52,6 @@ uint32_t mx25_size(void);
int
mx25_read
(
uint32_t
lba
,
uint8_t
*
buffer
);
int
mx25_write
(
uint32_t
lba
,
uint8_t
*
buffer
);
int
mx25_ready
(
void
);
int
mx25_sync
(
void
);
#endif
/* __MX25_H__ */
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