11 changed files with 100 additions and 26 deletions
Binary file not shown.
@ -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_ */ |
||||
Loading…
Reference in new issue