diff --git a/components/lvgl/env_support/cmake/esp.cmake b/components/lvgl/env_support/cmake/esp.cmake index edc370991..a8af4bcea 100644 --- a/components/lvgl/env_support/cmake/esp.cmake +++ b/components/lvgl/env_support/cmake/esp.cmake @@ -43,7 +43,7 @@ else() idf_component_register(SRCS ${SOURCES} ${EXAMPLE_SOURCES} ${DEMO_SOURCES} INCLUDE_DIRS ${LVGL_ROOT_DIR} ${LVGL_ROOT_DIR}/src ${LVGL_ROOT_DIR}/../ ${LVGL_ROOT_DIR}/examples ${LVGL_ROOT_DIR}/demos - REQUIRES esp_timer) + REQUIRES esp_timer heap) endif() target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_CONF_INCLUDE_SIMPLE") diff --git a/components/lvgl/src/extra/libs/png/lodepng.c b/components/lvgl/src/extra/libs/png/lodepng.c index 82e18e1a0..2606168b3 100644 --- a/components/lvgl/src/extra/libs/png/lodepng.c +++ b/components/lvgl/src/extra/libs/png/lodepng.c @@ -71,11 +71,29 @@ lodepng source code. Don't forget to remove "static" if you copypaste them from here.*/ #ifdef LODEPNG_COMPILE_ALLOCATORS + +/* ESP-IDF: LVGL's lv_mem pool is too small for full-tile PNG decode; prefer PSRAM when enabled. */ +#if defined(ESP_PLATFORM) && defined(CONFIG_SPIRAM) +#include "esp_heap_caps.h" +#define LODEPNG_ALLOC_ESP_PSRAM 1 +#else +#define LODEPNG_ALLOC_ESP_PSRAM 0 +#endif + static void* lodepng_malloc(size_t size) { #ifdef LODEPNG_MAX_ALLOC if(size > LODEPNG_MAX_ALLOC) return 0; #endif +#if LODEPNG_ALLOC_ESP_PSRAM + { + void *p = heap_caps_malloc(size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT); + if(p) return p; + p = heap_caps_malloc(size, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT); + return p; + } +#else return lv_mem_alloc(size); +#endif } /* NOTE: when realloc returns NULL, it leaves the original memory untouched */ @@ -83,11 +101,26 @@ static void* lodepng_realloc(void* ptr, size_t new_size) { #ifdef LODEPNG_MAX_ALLOC if(new_size > LODEPNG_MAX_ALLOC) return 0; #endif +#if LODEPNG_ALLOC_ESP_PSRAM + if(ptr == NULL) { + return lodepng_malloc(new_size); + } + if(new_size == 0) { + free(ptr); + return NULL; + } + return heap_caps_realloc(ptr, new_size, MALLOC_CAP_SPIRAM | MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT); +#else return lv_mem_realloc(ptr, new_size); +#endif } static void lodepng_free(void* ptr) { +#if LODEPNG_ALLOC_ESP_PSRAM + free(ptr); +#else lv_mem_free(ptr); +#endif } #else /*LODEPNG_COMPILE_ALLOCATORS*/ /* TODO: support giving additional void* payload to the custom allocators */ diff --git a/configs/sdkconfig.somethingsomething b/configs/sdkconfig.somethingsomething index 647d1e466..4c16fc6b6 100644 --- a/configs/sdkconfig.somethingsomething +++ b/configs/sdkconfig.somethingsomething @@ -3619,7 +3619,7 @@ CONFIG_LV_DRAW_COMPLEX=y CONFIG_LV_SHADOW_CACHE_SIZE=0 CONFIG_LV_CIRCLE_CACHE_SIZE=4 CONFIG_LV_LAYER_SIMPLE_BUF_SIZE=4800 -CONFIG_LV_IMG_CACHE_DEF_SIZE=0 +CONFIG_LV_IMG_CACHE_DEF_SIZE=16 CONFIG_LV_GRADIENT_MAX_STOPS=2 CONFIG_LV_GRAD_CACHE_DEF_SIZE=0 # CONFIG_LV_DITHER_GRADIENT is not set @@ -3823,14 +3823,17 @@ CONFIG_LV_USE_GRID=y # # 3rd Party Libraries # -# CONFIG_LV_USE_FS_STDIO is not set +CONFIG_LV_USE_FS_STDIO=y +CONFIG_LV_FS_STDIO_LETTER=83 +CONFIG_LV_FS_STDIO_PATH="" +CONFIG_LV_FS_STDIO_CACHE_SIZE=0 # CONFIG_LV_USE_FS_POSIX is not set # CONFIG_LV_USE_FS_WIN32 is not set # CONFIG_LV_USE_FS_FATFS is not set # CONFIG_LV_USE_FS_LITTLEFS is not set -# CONFIG_LV_USE_PNG is not set +CONFIG_LV_USE_PNG=y +CONFIG_LV_USE_SJPG=y # CONFIG_LV_USE_BMP is not set -# CONFIG_LV_USE_SJPG is not set # CONFIG_LV_USE_GIF is not set # CONFIG_LV_USE_QRCODE is not set # CONFIG_LV_USE_FREETYPE is not set diff --git a/docs/hugo docs/content/latest/flipper-app/gps-features.md b/docs/hugo docs/content/latest/flipper-app/gps-features.md index 665bea9e7..848a5a5d9 100644 --- a/docs/hugo docs/content/latest/flipper-app/gps-features.md +++ b/docs/hugo docs/content/latest/flipper-app/gps-features.md @@ -20,6 +20,10 @@ keywords: ["gps", "wardriving", "location", "tracking", "coordinates"] - **BLE Wardriving**: Log BLE devices with GPS coordinates (CSV export) - **Combined Mapping**: Map both networks and devices on a single view +## Offline map tiles (device SD) + +Display firmware can show **cached map imagery** from the SD card (not live map downloads on the device). Open **Apps** → **Maps** after copying Slippy tiles under `/mnt/ghostesp/maps/