Migrating from v8 to v9 which function replaces:
lv_img_cache_invalidate_src(NULL);
Migrating from v8 to v9 which function replaces:
lv_img_cache_invalidate_src(NULL);
Hello,
it seems cache invalidation has changed inV9.
From the docs:
Clean the cache
Let’s say you have loaded a PNG image into a
lv_image_dsc_t
my_png
variable and use it in anlv_image
object. If the image is already cached and you then change the underlying PNG file, you need to notify LVGL to cache the image again. Otherwise, there is no easy way of detecting that the underlying file changed and LVGL will still draw the old image from cache.To do this, use
lv_cache_invalidate(lv_cache_find(&my_png, LV_CACHE_SRC_TYPE_PTR, 0, 0));.
https://docs.lvgl.io/9.2/overview/image.html#clean-the-cache
I had already seen it in the documentation.
but there is no code for this function:
bms/GUI/screen_tela_1.c:374:5: warning: implicit declaration of function ‘lv_cache_invalidate’; did you mean ‘lv_obj_invalidate’? [-Wimplicit-function-declaration]
lv_cache_invalidate(lv_cache_find(&BackgroundBat, LV_CACHE_SRC_TYPE_PTR, 0, 0));
bms/GUI/screen_tela_1.c:374:25: warning: implicit declaration of function ‘lv_cache_find’; did you mean ‘lv_cache_add’? [-Wimplicit-function-declaration]
lv_cache_invalidate(lv_cache_find(&BackgroundBat, LV_CACHE_SRC_TYPE_PTR, 0, 0));
bms/GUI/screen_tela_1.c:374:55: error: ‘LV_CACHE_SRC_TYPE_PTR’ undeclared (first use in this function); did you mean ‘LV_CHART_TYPE_BAR’?
lv_cache_invalidate(lv_cache_find(&BackgroundBat, LV_CACHE_SRC_TYPE_PTR, 0, 0));
You are correct… Faulty documentation it seems.
I could only find lv_image_cache_drop()
which seems to do what you want.
Not sure why they changed this, especially considering the documentation is completely incorrect considering this