BigW Consortium Gitlab

Commit 1696d775 by Gabor

lv_app_files: sned bugfix (first chunk was not sent)

parent 92e63fbb
...@@ -769,12 +769,6 @@ static void start_send(lv_app_inst_t * app, const char * path) ...@@ -769,12 +769,6 @@ static void start_send(lv_app_inst_t * app, const char * path)
/*Open the file*/ /*Open the file*/
fs_res_t res = fs_open(&app_data->file, path, FS_MODE_RD); fs_res_t res = fs_open(&app_data->file, path, FS_MODE_RD);
if(res == FS_RES_OK) { 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; app_data->send_in_prog = 1;
/*Send the header*/ /*Send the header*/
...@@ -802,8 +796,6 @@ static void start_send(lv_app_inst_t * app, const char * path) ...@@ -802,8 +796,6 @@ static void start_send(lv_app_inst_t * app, const char * path)
if(app_data->send_fn != 0 || app_data->send_size != 0 || app_data->send_crc != 0) { 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); lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, "\n", 1);
} }
}
} }
/*If an error occurred close the file*/ /*If an error occurred close the file*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment