修改lvgl。cjson内存管理器
This commit is contained in:
1 parent
552a916705
commit
541738319d
11 files changed
+100
-26
No files matched your search
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2026-01-24 Administrator the first version
|
||||
*/
|
||||
#include <rtthread.h>
|
||||
#include "lvgl.h"
|
||||
#include <stddef.h>
|
||||
|
||||
extern struct rt_memheap sdram_heap; //
|
||||
|
||||
void *lv_custom_mem_alloc(size_t size)
|
||||
{
|
||||
return rt_memheap_alloc(&sdram_heap, size);
|
||||
}
|
||||
|
||||
void lv_custom_mem_free(void *ptr)
|
||||
{
|
||||
if (ptr) rt_memheap_free(ptr);
|
||||
}
|
||||
|
||||
void *lv_custom_mem_realloc(void *ptr, size_t new_size)
|
||||
{
|
||||
return rt_memheap_realloc(&sdram_heap, ptr, new_size);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2026-01-24 Administrator the first version
|
||||
*/
|
||||
#ifndef APPLICATIONS_LVGL_LV_PORT_MEM_H_
|
||||
#define APPLICATIONS_LVGL_LV_PORT_MEM_H_
|
||||
|
||||
void *lv_custom_mem_alloc(size_t size);
|
||||
void lv_custom_mem_free(void *ptr);
|
||||
void *lv_custom_mem_realloc(void *ptr, size_t new_size);
|
||||
|
||||
#endif /* APPLICATIONS_LVGL_LV_PORT_MEM_H_ */
|
||||
Reference in new issue
Block a user