v1.1.2:add audio and efuse patch

This commit is contained in:
刘可亮
2025-03-14 16:31:58 +08:00
parent fe0b990053
commit 049676e8a8
27 changed files with 380 additions and 119 deletions

View File

@@ -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
}

View File

@@ -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
}