Files
luban-lite/packages/artinchip/lvgl-ui/lv_demo.c

51 lines
1.1 KiB
C
Raw Normal View History

2023-08-30 16:21:18 +08:00
/*
2025-10-21 13:59:50 +08:00
* Copyright (C) 2022-2025 ArtInChip Technology Co., Ltd.
2023-08-30 16:21:18 +08:00
*
* SPDX-License-Identifier: Apache-2.0
*
*/
#include <lvgl.h>
2023-11-09 20:19:51 +08:00
#ifdef KERNEL_RTTHREAD
2023-08-30 16:21:18 +08:00
#include <rtthread.h>
2023-11-09 20:19:51 +08:00
#endif
2025-07-22 11:15:46 +08:00
2023-08-30 16:21:18 +08:00
#include "aic_core.h"
#include "aic_osal.h"
#include "aic_ui.h"
#include <dfs_fs.h>
2023-11-30 19:48:02 +08:00
#include "aic_time.h"
2023-08-30 16:21:18 +08:00
2025-07-22 11:15:46 +08:00
void lv_wait_fs_mounted(void)
2023-08-30 16:21:18 +08:00
{
2025-07-22 11:15:46 +08:00
struct dfs_filesystem *fs = NULL;
for (int i = 0; i < 1000; i++) {
fs = dfs_filesystem_lookup(LVGL_STORAGE_PATH);
if (fs != NULL) {
/* Continue to look up until fs->path is not equal to '/'. */
if (strncmp(LVGL_STORAGE_PATH, fs->path, 3) == 0)
return;
}
aicos_msleep(10);
2023-11-30 19:48:02 +08:00
}
2025-07-22 11:15:46 +08:00
LV_LOG_ERROR("Wait fs mound timeout, path: %s\n", LVGL_STORAGE_PATH);
2024-10-30 16:50:31 +08:00
}
2023-11-30 19:48:02 +08:00
2024-10-30 16:50:31 +08:00
void lv_user_gui_init(void)
{
2025-10-21 13:59:50 +08:00
#if defined(AIC_LVGL_DEMO) && !defined(RT_USING_MODULE)
2023-08-30 16:21:18 +08:00
aic_ui_init();
2025-01-08 19:12:06 +08:00
#endif
2023-08-30 16:21:18 +08:00
}
2025-10-21 13:59:50 +08:00
#if defined KERNEL_RTTHREAD
#ifdef RT_USING_MODULE
extern int dm_daemon(void);
INIT_LATE_APP_EXPORT(dm_daemon);
#else
2023-08-30 16:21:18 +08:00
extern int lvgl_thread_init(void);
2024-09-03 11:16:08 +08:00
INIT_LATE_APP_EXPORT(lvgl_thread_init);
2025-10-21 13:59:50 +08:00
#endif // RT_USING_MODULE
#endif // KERNEL_RTTHREAD