Use L:/file.png instead of /littlefs/file.png

This commit is contained in:
fvanroie 2021-08-10 01:55:48 +02:00
parent 7efac54de3
commit 34112882a1
4 changed files with 6 additions and 7 deletions

View File

@ -231,10 +231,6 @@ typedef void* lv_fs_drv_user_data_t;
/*Declare the type of the user data of image decoder (can be e.g. `void *`, `int`, `struct`)*/ /*Declare the type of the user data of image decoder (can be e.g. `void *`, `int`, `struct`)*/
typedef void* lv_img_decoder_user_data_t; typedef void* lv_img_decoder_user_data_t;
#if (HASP_USE_PNGDECODE > 0) && (LV_USE_FILESYSTEM > 0)
//#define LV_PNG_USE_LV_FILESYSTEM 1
#endif
/*===================== /*=====================
* Compiler settings * Compiler settings
*====================*/ *====================*/

View File

@ -150,11 +150,11 @@ static lv_fs_res_t fs_open(lv_fs_drv_t* drv, void* file_p, const char* path, lv_
char buf[256]; char buf[256];
sprintf(buf, LV_FS_PC_PATH "\\%s", path); sprintf(buf, LV_FS_PC_PATH "\\%s", path);
#endif #endif
printf("Opening file: %s\n", path); // printf("Opening file: %s (%s)\n", buf, path);
file_t f = fopen(buf, flags); file_t f = fopen(buf, flags);
if(f == NULL) { if(f == NULL) {
printf("Failed to open %s\n", buf); // printf("Failed to open %s\n", buf);
return LV_FS_RES_UNKNOWN; return LV_FS_RES_UNKNOWN;
} }
/*Be sure we are the beginning of the file*/ /*Be sure we are the beginning of the file*/
@ -231,6 +231,7 @@ static lv_fs_res_t fs_seek(lv_fs_drv_t* drv, void* file_p, uint32_t pos)
(void)drv; /*Unused*/ (void)drv; /*Unused*/
file_t* fp = file_p; /*Just avoid the confusing casings*/ file_t* fp = file_p; /*Just avoid the confusing casings*/
fseek(*fp, pos, SEEK_SET); fseek(*fp, pos, SEEK_SET);
// printf("Seek size: %u\n", pos);
return LV_FS_RES_OK; return LV_FS_RES_OK;
} }
@ -250,6 +251,7 @@ static lv_fs_res_t fs_size(lv_fs_drv_t* drv, void* file_p, uint32_t* size_p)
fseek(*fp, 0L, SEEK_END); fseek(*fp, 0L, SEEK_END);
*size_p = ftell(*fp); *size_p = ftell(*fp);
// printf("File size: %u\n", *size_p);
/*Restore file pointer*/ /*Restore file pointer*/
fseek(*fp, cur, SEEK_SET); fseek(*fp, cur, SEEK_SET);

View File

@ -6,7 +6,7 @@
/********************* /*********************
* INCLUDES * INCLUDES
*********************/ *********************/
#ifdef ARDUINO #if 0 &&defined(ARDUINO)
#include <Arduino.h> #include <Arduino.h>
#include "lv_fs_if.h" #include "lv_fs_if.h"

View File

@ -50,6 +50,7 @@ build_flags =
-D LV_COMP_CONF_INCLUDE_SIMPLE ; for components -D LV_COMP_CONF_INCLUDE_SIMPLE ; for components
-D LV_SYMBOL_DEF_H ; don't load default symbol defines -D LV_SYMBOL_DEF_H ; don't load default symbol defines
-D LODEPNG_NO_COMPILE_ALLOCATORS ; use PSram functions -D LODEPNG_NO_COMPILE_ALLOCATORS ; use PSram functions
-D LV_PNG_USE_LV_FILESYSTEM=1 ; use lvgl filesystem api, drive L:\
; -- ESP build options ------------------------------------ ; -- ESP build options ------------------------------------
-D SPIFFS_TEMPORAL_FD_CACHE ; speedup opening recent files -D SPIFFS_TEMPORAL_FD_CACHE ; speedup opening recent files
; -- ArduinoJson build options ---------------------------- ; -- ArduinoJson build options ----------------------------