2018-03-25 08:27:48 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "lvgl_mem.h"
|
|
|
|
#include <zephyr.h>
|
|
|
|
#include <init.h>
|
|
|
|
|
2020-12-07 21:53:28 +08:00
|
|
|
K_HEAP_DEFINE(lvgl_mem_pool, CONFIG_LVGL_MEM_POOL_MAX_SIZE *
|
|
|
|
CONFIG_LVGL_MEM_POOL_NUMBER_BLOCKS);
|
2018-03-25 08:27:48 +08:00
|
|
|
|
|
|
|
void *lvgl_malloc(size_t size)
|
|
|
|
{
|
2020-12-07 21:53:28 +08:00
|
|
|
return k_heap_alloc(&lvgl_mem_pool, size, K_NO_WAIT);
|
2018-03-25 08:27:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void lvgl_free(void *ptr)
|
|
|
|
{
|
2020-12-07 21:53:28 +08:00
|
|
|
k_heap_free(&lvgl_mem_pool, ptr);
|
2018-03-25 08:27:48 +08:00
|
|
|
}
|