mirror of https://github.com/arendst/Tasmota.git
Merge pull request #12149 from s-hadinger/lvgl_image_cache
LVGL increase image cache when PSRAM is present
This commit is contained in:
commit
1adfa1d076
|
@ -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;
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue