LVGL increase image cache when PSRAM is present

This commit is contained in:
Stephan Hadinger 2021-05-21 18:24:41 +02:00
parent 8650875ceb
commit 46f89b93b3
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"));
}