From e8dac0921473aac12a7e0b4f1a663c3a45245ddf Mon Sep 17 00:00:00 2001 From: Mitch Bradley Date: Fri, 1 Mar 2024 09:37:18 -1000 Subject: [PATCH 1/3] Enable stdio filesystem support It was commented out. Uncommenting it and adding a namespace qualifier to load_font_with_path made it work great. Tested with platformio native builds on Windows/Mingw32 --- src/lgfx/v1/lgfx_filesystem_support.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lgfx/v1/lgfx_filesystem_support.hpp b/src/lgfx/v1/lgfx_filesystem_support.hpp index a1007371..73926097 100644 --- a/src/lgfx/v1/lgfx_filesystem_support.hpp +++ b/src/lgfx/v1/lgfx_filesystem_support.hpp @@ -62,6 +62,7 @@ namespace lgfx using Base::drawPngFile; using Base::drawQoiFile; using Base::loadFont; + using Base::load_font_with_path; #if defined (ARDUINO) @@ -262,7 +263,7 @@ namespace lgfx #endif #endif -/* + #elif defined (ESP_PLATFORM) || defined(__SAMD51_HARMONY__) || defined(stdin) // ESP-IDF, Harmony, stdio #define LGFX_FUNCTION_GENERATOR(drawImg) \ @@ -290,7 +291,7 @@ namespace lgfx init_font_file(); return load_font_with_path(path); } -//*/ + #endif #define LGFX_URL_MAXLENGTH 2083 From 827e66ed8f80367b625d41c9efd15bde55aca9e5 Mon Sep 17 00:00:00 2001 From: Mitch Bradley Date: Fri, 1 Mar 2024 10:00:22 -1000 Subject: [PATCH 2/3] Omit filesystem support for ESP_PLATFORM and __SAMD51_HARMONY__ .. because the corresponding platforms do not have FileWrapper --- src/lgfx/v1/lgfx_filesystem_support.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lgfx/v1/lgfx_filesystem_support.hpp b/src/lgfx/v1/lgfx_filesystem_support.hpp index 73926097..599d37cf 100644 --- a/src/lgfx/v1/lgfx_filesystem_support.hpp +++ b/src/lgfx/v1/lgfx_filesystem_support.hpp @@ -264,7 +264,9 @@ namespace lgfx #endif #endif -#elif defined (ESP_PLATFORM) || defined(__SAMD51_HARMONY__) || defined(stdin) // ESP-IDF, Harmony, stdio +#elif defined(stdin) // ESP-IDF, Harmony, stdio + // #elif defined (ESP_PLATFORM) || defined(__SAMD51_HARMONY__) || defined(stdin) // ESP-IDF, Harmony, stdio + // esp32 and samd51 platforms do not have FileWrapper #define LGFX_FUNCTION_GENERATOR(drawImg) \ inline bool drawImg##File(const char *path, int32_t x = 0, int32_t y = 0, int32_t maxWidth = 0, int32_t maxHeight = 0, int32_t offX = 0, int32_t offY = 0, float scale_x = 1.0f, float scale_y = 0.0f, datum_t datum = datum_t::top_left) \ From 790ab46604832e00d9a49838cb6eb897fe629777 Mon Sep 17 00:00:00 2001 From: Mitch Bradley Date: Fri, 1 Mar 2024 10:30:34 -1000 Subject: [PATCH 3/3] Another try at enabling filesystem support without breaking IDF --- src/lgfx/v1/lgfx_filesystem_support.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lgfx/v1/lgfx_filesystem_support.hpp b/src/lgfx/v1/lgfx_filesystem_support.hpp index 599d37cf..b63d080d 100644 --- a/src/lgfx/v1/lgfx_filesystem_support.hpp +++ b/src/lgfx/v1/lgfx_filesystem_support.hpp @@ -264,9 +264,9 @@ namespace lgfx #endif #endif -#elif defined(stdin) // ESP-IDF, Harmony, stdio - // #elif defined (ESP_PLATFORM) || defined(__SAMD51_HARMONY__) || defined(stdin) // ESP-IDF, Harmony, stdio +#elif defined (ESP_PLATFORM) || defined(__SAMD51_HARMONY__) // esp32 and samd51 platforms do not have FileWrapper +#elif defined(stdin) #define LGFX_FUNCTION_GENERATOR(drawImg) \ inline bool drawImg##File(const char *path, int32_t x = 0, int32_t y = 0, int32_t maxWidth = 0, int32_t maxHeight = 0, int32_t offX = 0, int32_t offY = 0, float scale_x = 1.0f, float scale_y = 0.0f, datum_t datum = datum_t::top_left) \