From 34112882a17c1400968fe794df65d4fdac8b31a8 Mon Sep 17 00:00:00 2001 From: fvanroie <15969459+fvanroie@users.noreply.github.com> Date: Tue, 10 Aug 2021 01:55:48 +0200 Subject: [PATCH] Use L:/file.png instead of /littlefs/file.png --- include/lv_conf_v7.h | 4 ---- lib/lv_fs_if/lv_fs_pc.c | 6 ++++-- lib/lv_fs_if/lv_fs_spiffs.cpp | 2 +- platformio.ini | 1 + 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/include/lv_conf_v7.h b/include/lv_conf_v7.h index f921ce8b..29049812 100644 --- a/include/lv_conf_v7.h +++ b/include/lv_conf_v7.h @@ -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`)*/ 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 *====================*/ diff --git a/lib/lv_fs_if/lv_fs_pc.c b/lib/lv_fs_if/lv_fs_pc.c index a9277cb0..a7faeeab 100644 --- a/lib/lv_fs_if/lv_fs_pc.c +++ b/lib/lv_fs_if/lv_fs_pc.c @@ -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]; sprintf(buf, LV_FS_PC_PATH "\\%s", path); #endif - printf("Opening file: %s\n", path); + // printf("Opening file: %s (%s)\n", buf, path); file_t f = fopen(buf, flags); if(f == NULL) { - printf("Failed to open %s\n", buf); + // printf("Failed to open %s\n", buf); return LV_FS_RES_UNKNOWN; } /*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*/ file_t* fp = file_p; /*Just avoid the confusing casings*/ fseek(*fp, pos, SEEK_SET); + // printf("Seek size: %u\n", pos); 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); *size_p = ftell(*fp); + // printf("File size: %u\n", *size_p); /*Restore file pointer*/ fseek(*fp, cur, SEEK_SET); diff --git a/lib/lv_fs_if/lv_fs_spiffs.cpp b/lib/lv_fs_if/lv_fs_spiffs.cpp index dbc184fb..aa9ffd91 100644 --- a/lib/lv_fs_if/lv_fs_spiffs.cpp +++ b/lib/lv_fs_if/lv_fs_spiffs.cpp @@ -6,7 +6,7 @@ /********************* * INCLUDES *********************/ -#ifdef ARDUINO +#if 0 &&defined(ARDUINO) #include #include "lv_fs_if.h" diff --git a/platformio.ini b/platformio.ini index 2fcbfbcf..963ae4bf 100644 --- a/platformio.ini +++ b/platformio.ini @@ -50,6 +50,7 @@ build_flags = -D LV_COMP_CONF_INCLUDE_SIMPLE ; for components -D LV_SYMBOL_DEF_H ; don't load default symbol defines -D LODEPNG_NO_COMPILE_ALLOCATORS ; use PSram functions + -D LV_PNG_USE_LV_FILESYSTEM=1 ; use lvgl filesystem api, drive L:\ ; -- ESP build options ------------------------------------ -D SPIFFS_TEMPORAL_FD_CACHE ; speedup opening recent files ; -- ArduinoJson build options ----------------------------