Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r 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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
toerb
flow3r firmware
Commits
d088487c
Commit
d088487c
authored
1 year ago
by
schneider
Committed by
q3k
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
recovery: show progress bar
parent
bbb3f61d
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
recovery/main/rec_gui.c
+18
-0
18 additions, 0 deletions
recovery/main/rec_gui.c
recovery/main/rec_gui.h
+2
-1
2 additions, 1 deletion
recovery/main/rec_gui.h
recovery/main/rec_main.c
+6
-0
6 additions, 0 deletions
recovery/main/rec_main.c
with
26 additions
and
1 deletion
recovery/main/rec_gui.c
+
18
−
0
View file @
d088487c
...
...
@@ -42,6 +42,24 @@ void rec_erasing_draw(void) {
st3m_gfx_drawctx_pipe_put
(
target
);
}
void
rec_flashing_draw
(
int
percent
)
{
st3m_ctx_desc_t
*
target
=
st3m_gfx_drawctx_free_get
(
portMAX_DELAY
);
_header_draw
(
target
);
ctx_move_to
(
target
->
ctx
,
0
,
0
);
ctx_font_size
(
target
->
ctx
,
20
.
0
);
ctx_gray
(
target
->
ctx
,
0
.
8
);
char
buf
[
128
];
snprintf
(
buf
,
sizeof
(
buf
),
"Flashing... %2d%%"
,
percent
);
ctx_text
(
target
->
ctx
,
buf
);
ctx_rectangle
(
target
->
ctx
,
-
120
,
20
,
240
*
percent
/
100
,
20
);
ctx_fill
(
target
->
ctx
);
st3m_gfx_drawctx_pipe_put
(
target
);
}
void
rec_menu_draw
(
menu_t
*
menu
)
{
st3m_ctx_desc_t
*
target
=
st3m_gfx_drawctx_free_get
(
portMAX_DELAY
);
_header_draw
(
target
);
...
...
This diff is collapsed.
Click to expand it.
recovery/main/rec_gui.h
+
2
−
1
View file @
d088487c
...
...
@@ -17,5 +17,6 @@ typedef struct {
}
menu_t
;
void
rec_erasing_draw
(
void
);
void
rec_flashing_draw
(
int
percent
);
void
rec_menu_draw
(
menu_t
*
menu
);
void
rec_menu_process
(
menu_t
*
menu
);
This diff is collapsed.
Click to expand it.
recovery/main/rec_main.c
+
6
−
0
View file @
d088487c
...
...
@@ -127,6 +127,11 @@ static void _list_select(void) {
rec_fatal
(
"Could not open file :("
);
}
fseek
(
f
,
0
,
SEEK_END
);
size_t
size
=
ftell
(
f
);
fseek
(
f
,
0
,
SEEK_SET
);
rec_flashing_draw
(
0
);
do
{
n
=
fread
(
buf
,
1
,
sizeof
(
buf
),
f
);
if
(
n
>
0
)
{
...
...
@@ -134,6 +139,7 @@ static void _list_select(void) {
esp_partition_write
(
p
,
offset
,
buf
,
n
);
offset
+=
n
;
ESP_LOGI
(
TAG
,
"wrote %u bytes"
,
offset
);
rec_flashing_draw
(
offset
*
100
/
size
);
}
}
while
(
n
==
sizeof
(
buf
));
...
...
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