BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lvgl
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
lvgl
Commits
1696d775
Commit
1696d775
authored
Mar 09, 2017
by
Gabor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv_app_files: sned bugfix (first chunk was not sent)
parent
92e63fbb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
33 deletions
+25
-33
lv_app_files.c
lv_appx/lv_app_files.c
+25
-33
No files found.
lv_appx/lv_app_files.c
View file @
1696d775
...
...
@@ -769,41 +769,33 @@ static void start_send(lv_app_inst_t * app, const char * path)
/*Open the file*/
fs_res_t
res
=
fs_open
(
&
app_data
->
file
,
path
,
FS_MODE_RD
);
if
(
res
==
FS_RES_OK
)
{
uint32_t
rn
;
char
rd_buf
[
LV_APP_FILES_CHUNK_MAX_SIZE
];
/*Read the first chunk*/
res
=
fs_read
(
&
app_data
->
file
,
rd_buf
,
app_data
->
chunk_size
,
&
rn
);
if
(
res
==
FS_RES_OK
)
{
app_data
->
send_in_prog
=
1
;
/*Send the header*/
if
(
app_data
->
send_fn
!=
0
)
{
lv_app_com_send
(
app
,
LV_APP_COM_TYPE_CHAR
,
app_data
->
path
,
strlen
(
app_data
->
path
));
lv_app_com_send
(
app
,
LV_APP_COM_TYPE_CHAR
,
"/"
,
1
);
lv_app_com_send
(
app
,
LV_APP_COM_TYPE_CHAR
,
app_data
->
fn
,
strlen
(
app_data
->
fn
));
lv_app_com_send
(
app
,
LV_APP_COM_TYPE_CHAR
,
"
\n
"
,
1
);
}
if
(
app_data
->
send_size
!=
0
)
{
char
buf
[
64
];
uint32_t
size
;
fs_size
(
&
app_data
->
file
,
&
size
);
sprintf
(
buf
,
"%d"
,
(
int
)
size
);
lv_app_com_send
(
app
,
LV_APP_COM_TYPE_CHAR
,
buf
,
strlen
(
buf
));
lv_app_com_send
(
app
,
LV_APP_COM_TYPE_CHAR
,
"
\n
"
,
1
);
}
if
(
app_data
->
send_crc
!=
0
)
{
lv_app_com_send
(
app
,
LV_APP_COM_TYPE_CHAR
,
"0x0000"
,
6
);
lv_app_com_send
(
app
,
LV_APP_COM_TYPE_CHAR
,
"
\n
"
,
1
);
}
/*Add an extra \n to separate the header from the file data*/
if
(
app_data
->
send_fn
!=
0
||
app_data
->
send_size
!=
0
||
app_data
->
send_crc
!=
0
)
{
lv_app_com_send
(
app
,
LV_APP_COM_TYPE_CHAR
,
"
\n
"
,
1
);
}
app_data
->
send_in_prog
=
1
;
/*Send the header*/
if
(
app_data
->
send_fn
!=
0
)
{
lv_app_com_send
(
app
,
LV_APP_COM_TYPE_CHAR
,
app_data
->
path
,
strlen
(
app_data
->
path
));
lv_app_com_send
(
app
,
LV_APP_COM_TYPE_CHAR
,
"/"
,
1
);
lv_app_com_send
(
app
,
LV_APP_COM_TYPE_CHAR
,
app_data
->
fn
,
strlen
(
app_data
->
fn
));
lv_app_com_send
(
app
,
LV_APP_COM_TYPE_CHAR
,
"
\n
"
,
1
);
}
if
(
app_data
->
send_size
!=
0
)
{
char
buf
[
64
];
uint32_t
size
;
fs_size
(
&
app_data
->
file
,
&
size
);
sprintf
(
buf
,
"%d"
,
(
int
)
size
);
lv_app_com_send
(
app
,
LV_APP_COM_TYPE_CHAR
,
buf
,
strlen
(
buf
));
lv_app_com_send
(
app
,
LV_APP_COM_TYPE_CHAR
,
"
\n
"
,
1
);
}
if
(
app_data
->
send_crc
!=
0
)
{
lv_app_com_send
(
app
,
LV_APP_COM_TYPE_CHAR
,
"0x0000"
,
6
);
lv_app_com_send
(
app
,
LV_APP_COM_TYPE_CHAR
,
"
\n
"
,
1
);
}
/*Add an extra \n to separate the header from the file data*/
if
(
app_data
->
send_fn
!=
0
||
app_data
->
send_size
!=
0
||
app_data
->
send_crc
!=
0
)
{
lv_app_com_send
(
app
,
LV_APP_COM_TYPE_CHAR
,
"
\n
"
,
1
);
}
}
/*If an error occurred close the file*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment