refactor(nuttx_image_cache): remove LV_CACHE_DEF_SIZE dependency (#6178)
This commit is contained in:
@@ -104,9 +104,7 @@ void lv_nuttx_init(const lv_nuttx_dsc_t * dsc, lv_nuttx_result_t * result)
|
||||
|
||||
lv_nuttx_cache_init();
|
||||
|
||||
#if LV_CACHE_DEF_SIZE > 0
|
||||
lv_nuttx_image_cache_init();
|
||||
#endif
|
||||
|
||||
#if LV_USE_PROFILER && LV_USE_PROFILER_BUILTIN
|
||||
lv_nuttx_profiler_init();
|
||||
|
||||
@@ -44,13 +44,7 @@ typedef struct {
|
||||
} lv_nuttx_result_t;
|
||||
|
||||
typedef struct _lv_nuttx_ctx_t {
|
||||
|
||||
#if LV_CACHE_DEF_SIZE > 0
|
||||
void * image_cache;
|
||||
#else
|
||||
void * dummy;
|
||||
#endif
|
||||
|
||||
} lv_nuttx_ctx_t;
|
||||
|
||||
/**********************
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
#include "lv_nuttx_image_cache.h"
|
||||
#include "../../../lvgl.h"
|
||||
|
||||
#if LV_CACHE_DEF_SIZE > 0
|
||||
|
||||
#if LV_USE_NUTTX
|
||||
|
||||
#include <nuttx/mm/mm.h>
|
||||
@@ -78,6 +76,11 @@ static bool defer_init(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
if(img_cache_p->max_size == 0) {
|
||||
LV_LOG_INFO("Image cache is not initialized yet. Skipping deferred initialization. Because max_size is 0.");
|
||||
return false;
|
||||
}
|
||||
|
||||
ctx->mem_size = img_cache_p->max_size;
|
||||
ctx->mem = malloc(ctx->mem_size);
|
||||
LV_ASSERT_MALLOC(ctx->mem);
|
||||
@@ -150,4 +153,3 @@ static void free_cb(void * draw_buf)
|
||||
}
|
||||
|
||||
#endif /* LV_USE_NUTTX */
|
||||
#endif /* LV_CACHE_DEF_SIZE > 0 */
|
||||
|
||||
@@ -16,8 +16,6 @@ extern "C" {
|
||||
|
||||
#include "../../lv_conf_internal.h"
|
||||
|
||||
#if LV_CACHE_DEF_SIZE > 0
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
@@ -36,8 +34,6 @@ void lv_nuttx_image_cache_init(void);
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif /*LV_CACHE_DEF_SIZE > 0*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user