From 6a8bbce6ecfbe583b2f2bcdb6864aaa0f283dd8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Thu, 15 Feb 2024 17:37:08 +0100 Subject: [PATCH] Restore lv_fs_if_init() on Arduino build --- src/hasp_config.cpp | 1 - src/hasp_gui.cpp | 1 + src/main.cpp | 5 +++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/hasp_config.cpp b/src/hasp_config.cpp index 4bdb7c80..75ac0bb5 100644 --- a/src/hasp_config.cpp +++ b/src/hasp_config.cpp @@ -265,7 +265,6 @@ DeserializationError configParseFile(String& configFile, JsonDocument& settings) } return DeserializationError::InvalidInput; #elif HASP_TARGET_PC - lv_fs_if_init(); lv_fs_file_t f; lv_fs_res_t res; lv_fs_open(&f, "L:/config.json", LV_FS_MODE_RD); diff --git a/src/hasp_gui.cpp b/src/hasp_gui.cpp index 9fd55c9b..13caf317 100644 --- a/src/hasp_gui.cpp +++ b/src/hasp_gui.cpp @@ -208,6 +208,7 @@ static inline void gui_init_filesystems() { #if LV_USE_FS_IF != 0 LOG_VERBOSE(TAG_LVGL, F("Filesystem : " D_SETTING_ENABLED)); + lv_fs_if_init(); // auxiliary file system drivers #else LOG_VERBOSE(TAG_LVGL, F("Filesystem : " D_SETTING_DISABLED)); #endif diff --git a/src/main.cpp b/src/main.cpp index 68a51af3..b065909c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -48,6 +48,11 @@ void setup() // Initialize lvgl environment lv_init(); lv_log_register_print_cb(debugLvglLogEvent); +#if HASP_USE_CONFIG + // initialize FS before running configSetup() + // normally, it's initialized in guiSetup(), but Arduino doesn't need FS in configSetup() + lv_fs_if_init(); +#endif #endif haspDevice.init();