Merge pull request #12149 from s-hadinger/lvgl_image_cache

LVGL increase image cache when PSRAM is present
This commit is contained in:
s-hadinger 2021-05-21 18:39:36 +02:00 committed by GitHub
commit 1adfa1d076
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -259,6 +259,7 @@ typedef void * lv_fs_drv_user_data_t;
* However the opened images might consume additional RAM.
* Set it to 0 to disable caching */
#define LV_IMG_CACHE_DEF_SIZE 1
#define LV_IMG_CACHE_DEF_SIZE_PSRAM 20 // special Tasmota setting when PSRAM is used
/*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;

View File

@ -445,6 +445,10 @@ void start_lvgl(const char * uconfig) {
lv_png_init();
#endif // USE_LVGL_PNG_DECODER
if (psramFound()) {
lv_img_cache_set_size(LV_IMG_CACHE_DEF_SIZE_PSRAM);
}
AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_LVGL "LVGL initialized"));
}