zephyr/lib/gui/lvgl/lvgl_mem_kernel.c
Jan Van Winkel cbfcae7a1f gui: Added glue logic for LittlevGL GUI library
Added glue logic to interface Zephyr with LittlevGL GUI library

This includes:
 * KConfig options for all lvgl options
 * Kernel & user space memory management
 * Zephyr to lvgl FS call mapping
 * Color space conversion function

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-01-07 16:05:35 -05:00

26 lines
473 B
C

/*
* 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>
#include <misc/mempool.h>
K_MEM_POOL_DEFINE(lvgl_mem_pool,
CONFIG_LVGL_MEM_POOL_MIN_SIZE,
CONFIG_LVGL_MEM_POOL_MAX_SIZE,
CONFIG_LVGL_MEM_POOL_NUMBER_BLOCKS, 4);
void *lvgl_malloc(size_t size)
{
return k_mem_pool_malloc(&lvgl_mem_pool, size);
}
void lvgl_free(void *ptr)
{
k_free(ptr);
}