From 60fb4f759a7b3b1eefc969a6e49700a377fad876 Mon Sep 17 00:00:00 2001 From: fvanroie Date: Wed, 25 Nov 2020 16:47:53 +0100 Subject: [PATCH] Test lv_fs_if --- include/lv_conf.h | 8 ++++---- platformio.ini | 9 +++++---- src/hasp_config.cpp | 4 ++-- src/hasp_gui.cpp | 9 +++++---- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/include/lv_conf.h b/include/lv_conf.h index 257b49e3..dec39ee2 100644 --- a/include/lv_conf.h +++ b/include/lv_conf.h @@ -181,11 +181,11 @@ typedef void* lv_group_user_data_t; typedef void* lv_fs_drv_user_data_t; /*File system interface*/ -#define LV_USE_FS_IF 0 +#define LV_USE_FS_IF 1 #if LV_USE_FS_IF # define LV_FS_IF_FATFS '\0' # define LV_FS_IF_PC '\0' -# define LV_FS_IF_SPIFFS 'F' // internal Flash +# define LV_FS_IF_SPIFFS 'E' // internal esp Flash #endif /*LV_USE_FS_IF*/ #endif @@ -338,7 +338,7 @@ typedef void* lv_indev_drv_user_data_t; /*Type of user data in the in /* Demonstrate special features */ #define LV_FONT_MONTSERRAT_12_SUBPX 0 -#define LV_FONT_MONTSERRAT_28_COMPRESSED LV_HIGH_RESOURCE_MCU /*bpp = 3*/ +#define LV_FONT_MONTSERRAT_28_COMPRESSED 0 // LV_HIGH_RESOURCE_MCU /*bpp = 3*/ /*Pixel perfect monospace font * http://pelulamu.net/unscii/ */ @@ -395,7 +395,7 @@ typedef void* lv_font_user_data_t; #define LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_12 #define LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_16 #define LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_22 -#define LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_28_compressed +#define LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_22 //&lv_font_montserrat_28_compressed #else #define LV_THEME_DEFAULT_FONT_SMALL LV_FONT_DEFAULT // &lv_font_montserrat_12 #define LV_THEME_DEFAULT_FONT_NORMAL LV_FONT_DEFAULT // &lv_font_montserrat_16 diff --git a/platformio.ini b/platformio.ini index 4148a8d3..746523ab 100644 --- a/platformio.ini +++ b/platformio.ini @@ -51,7 +51,7 @@ build_flags = ${override.build_flags} -D HASP_VERSION_MAJOR=0 -D HASP_VERSION_MINOR=2 - -D HASP_VERSION_REVISION=1124 + -D HASP_VERSION_REVISION=1125 ; -- Shared library dependencies in all environments lib_deps = @@ -86,7 +86,8 @@ build_flags = -D MQTT_MAX_PACKET_SIZE=2048 ; longer PubSubClient messages -D NO_GLOBAL_HTTPUPDATE ; dont instantiate httpUpdate ; -- lvgl build options ----------------------------- - -D LV_MEM_SIZE=20480U ; 20kB lvgl memory + -D LV_MEM_SIZE=61440U ; 60kB lvgl memory + ;-D LV_MEM_SIZE=10240U ; 10kB lvgl memory ; -- tft_espi build options ------------------------ ;-D USE_DMA_TO_TFT ;-D ESP32_DMA ; Make touch reads wait for DMA @@ -96,8 +97,8 @@ build_flags = -D HASP_USE_MDNS=1 -D HASP_USE_SYSLOG=1 -D HASP_USE_TELNET=1 - -D HASP_USE_SPIFFS=0 - -D HASP_USE_LITTLEFS=1 + -D HASP_USE_SPIFFS=1 + -D HASP_USE_LITTLEFS=0 -D HASP_USE_EEPROM=1 -D HASP_USE_GPIO=1 ; -- LittleFS build options ------------------------ diff --git a/src/hasp_config.cpp b/src/hasp_config.cpp index 95ed3bd4..eecf8a85 100644 --- a/src/hasp_config.cpp +++ b/src/hasp_config.cpp @@ -104,9 +104,9 @@ void configGetConfig(JsonDocument & settings, bool setupdebug = false) } error = deserializeJson(settings, file); - if(!error) { - file.close(); + file.close(); + if(!error) { /* Load Debug params */ if(setupdebug) { debugPreSetup(settings[F("debug")]); diff --git a/src/hasp_gui.cpp b/src/hasp_gui.cpp index 6412fea0..fcad0ebc 100644 --- a/src/hasp_gui.cpp +++ b/src/hasp_gui.cpp @@ -8,6 +8,10 @@ #include "lvgl.h" #include "lv_drv_conf.h" +// Filesystem Driver +#include "lv_misc/lv_fs.h" +#include "lv_fs_if.h" + // Select Display Driver #if defined(USE_FSMC) #include "fsmc_ili9341.h" @@ -19,9 +23,6 @@ //#include "indev/XPT2046_alt_drv.h" #include "indev/XPT2046.h" -// Filesystem Driver -#include "lv_fs_if.h" - //#include "lv_zifont.h" #include "hasp_conf.h" @@ -527,7 +528,7 @@ void guiSetup() /* Initialize Filesystems */ #if LV_USE_FS_IF != 0 - lv_fs_init(); // lvgl File System + _lv_fs_init(); // lvgl File System lv_fs_if_init(); // auxilary file system drivers #endif