1 /* 2 * Copyright (c) 2018 Jan Van Winkel <jan.van_winkel@dxplore.eu> 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #include "lvgl_mem.h" 8 #include <zephyr/kernel.h> 9 #include <zephyr/init.h> 10 11 K_HEAP_DEFINE(lvgl_mem_pool, CONFIG_LV_Z_MEM_POOL_MAX_SIZE * 12 CONFIG_LV_Z_MEM_POOL_NUMBER_BLOCKS); 13 lvgl_malloc(size_t size)14void *lvgl_malloc(size_t size) 15 { 16 return k_heap_alloc(&lvgl_mem_pool, size, K_NO_WAIT); 17 } 18 lvgl_free(void * ptr)19void lvgl_free(void *ptr) 20 { 21 k_heap_free(&lvgl_mem_pool, ptr); 22 } 23