diff --git a/modules/lvgl/Kconfig.memory b/modules/lvgl/Kconfig.memory index 29ccc8e910..efd7454046 100644 --- a/modules/lvgl/Kconfig.memory +++ b/modules/lvgl/Kconfig.memory @@ -31,27 +31,12 @@ choice LV_Z_MEMORY_POOL endchoice -if LV_Z_MEM_POOL_SYS_HEAP - -config LV_Z_MEM_POOL_MIN_SIZE - int "Minimum memory pool block size" - default 16 - help - Size of the smallest block in the memory pool in bytes - -config LV_Z_MEM_POOL_MAX_SIZE - int "Maximum memory pool block size" +config LV_Z_MEM_POOL_SIZE + int "Memory pool size" default 2048 + depends on LV_Z_MEM_POOL_SYS_HEAP help - Size of the largest block in the memory pool in bytes - -config LV_Z_MEM_POOL_NUMBER_BLOCKS - int "Number of max size blocks in memory pool" - default 1 - help - Number of maximum sized blocks in the memory pool. - -endif + Size of the memory pool in bytes config LV_Z_VDB_SIZE int "Rendering buffer size" diff --git a/modules/lvgl/include/lv_conf.h b/modules/lvgl/include/lv_conf.h index 20e60058ae..9dd7b510f7 100644 --- a/modules/lvgl/include/lv_conf.h +++ b/modules/lvgl/include/lv_conf.h @@ -11,6 +11,7 @@ /* Memory manager settings */ #define LV_MEMCPY_MEMSET_STD 1 +#define LV_MEM_CUSTOM 1 #if defined(CONFIG_LV_Z_MEM_POOL_HEAP_LIB_C) diff --git a/modules/lvgl/lvgl_mem.c b/modules/lvgl/lvgl_mem.c index ab6c912847..001546a23a 100644 --- a/modules/lvgl/lvgl_mem.c +++ b/modules/lvgl/lvgl_mem.c @@ -10,9 +10,7 @@ #include #include -#define HEAP_BYTES (CONFIG_LV_Z_MEM_POOL_MAX_SIZE * CONFIG_LV_Z_MEM_POOL_NUMBER_BLOCKS) - -static char lvgl_heap_mem[HEAP_BYTES] __aligned(8); +static char lvgl_heap_mem[CONFIG_LV_Z_MEM_POOL_SIZE] __aligned(8); static struct sys_heap lvgl_heap; static struct k_spinlock lvgl_heap_lock; @@ -60,5 +58,5 @@ void lvgl_print_heap_info(bool dump_chunks) void lvgl_heap_init(void) { - sys_heap_init(&lvgl_heap, &lvgl_heap_mem[0], HEAP_BYTES); + sys_heap_init(&lvgl_heap, &lvgl_heap_mem[0], CONFIG_LV_Z_MEM_POOL_SIZE); } diff --git a/samples/modules/lvgl/demos/prj.conf b/samples/modules/lvgl/demos/prj.conf index f7e061ef69..0b7217242f 100644 --- a/samples/modules/lvgl/demos/prj.conf +++ b/samples/modules/lvgl/demos/prj.conf @@ -3,7 +3,7 @@ CONFIG_LOG=y CONFIG_SHELL=y CONFIG_LVGL=y -CONFIG_LV_Z_MEM_POOL_NUMBER_BLOCKS=8 +CONFIG_LV_Z_MEM_POOL_SIZE=16384 CONFIG_LV_Z_SHELL=y CONFIG_LV_USE_MONKEY=y diff --git a/samples/subsys/display/lvgl/prj.conf b/samples/subsys/display/lvgl/prj.conf index 32ce28965e..41c0eca6e7 100644 --- a/samples/subsys/display/lvgl/prj.conf +++ b/samples/subsys/display/lvgl/prj.conf @@ -1,4 +1,4 @@ -CONFIG_LV_Z_MEM_POOL_NUMBER_BLOCKS=8 +CONFIG_LV_Z_MEM_POOL_SIZE=16384 CONFIG_LV_Z_SHELL=y CONFIG_MAIN_STACK_SIZE=2048 diff --git a/tests/lib/gui/lvgl/prj.conf b/tests/lib/gui/lvgl/prj.conf index 6a784fd28c..3e88939a88 100644 --- a/tests/lib/gui/lvgl/prj.conf +++ b/tests/lib/gui/lvgl/prj.conf @@ -13,7 +13,7 @@ CONFIG_FILE_SYSTEM=y CONFIG_FILE_SYSTEM_LITTLEFS=y CONFIG_LVGL=y -CONFIG_LV_Z_MEM_POOL_NUMBER_BLOCKS=8 +CONFIG_LV_Z_MEM_POOL_SIZE=16384 CONFIG_LV_Z_USE_FILESYSTEM=y CONFIG_LV_MEM_CUSTOM=y CONFIG_LV_USE_LOG=y diff --git a/tests/lib/gui/lvgl/testcase.yaml b/tests/lib/gui/lvgl/testcase.yaml index a2e7cc3e84..898c6d5880 100644 --- a/tests/lib/gui/lvgl/testcase.yaml +++ b/tests/lib/gui/lvgl/testcase.yaml @@ -22,8 +22,7 @@ tests: extra_configs: - CONFIG_LV_Z_BUFFER_ALLOC_DYNAMIC=y - CONFIG_LV_Z_MEM_POOL_SYS_HEAP=y - - CONFIG_LV_Z_MEM_POOL_NUMBER_BLOCKS=3 - - CONFIG_LV_Z_MEM_POOL_MAX_SIZE=32768 + - CONFIG_LV_Z_MEM_POOL_SIZE=98304 libraries.gui.lvgl.16bit: tags: - display