mirror of
https://gitee.com/Vancouver2017/luban-lite.git
synced 2025-12-15 16:48:56 +00:00
v1.1.2:add audio and efuse patch
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022-2024, ArtInChip Technology Co., Ltd
|
||||
* Copyright (c) 2022-2025, ArtInChip Technology Co., Ltd
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -161,6 +161,7 @@ static inline void aicos_msleep(uint32_t delay) {}
|
||||
|
||||
// memory
|
||||
void *aicos_malloc_try_cma(size_t size);
|
||||
void *aicos_malloc_align_try_cma(size_t size, size_t align);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022, ArtInChip Technology Co., Ltd
|
||||
* Copyright (c) 2022-2025, ArtInChip Technology Co., Ltd
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -101,3 +101,22 @@ extern bool lv_drop_one_cached_image();
|
||||
return aicos_malloc(MEM_CMA, size);
|
||||
#endif
|
||||
}
|
||||
|
||||
void *aicos_malloc_align_try_cma(size_t size, size_t align)
|
||||
{
|
||||
#if defined(LPKG_USING_LVGL)
|
||||
extern bool lv_drop_one_cached_image();
|
||||
while (1) {
|
||||
void *data = aicos_malloc_align(MEM_CMA, size, align);
|
||||
if (data)
|
||||
return data;
|
||||
|
||||
bool res = lv_drop_one_cached_image();
|
||||
if (res == false) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
#else
|
||||
return aicos_malloc_align(MEM_CMA, size, align);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user