Files
luban-lite-t3e-pro/application/rt-thread/helloworld/main.c

53 lines
1.1 KiB
C
Raw Normal View History

2023-08-30 16:21:18 +08:00
/*
* Copyright (c) 2022, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*
* Authors: weilin.peng@artinchip.com
*/
2023-11-09 20:19:51 +08:00
2023-08-30 16:21:18 +08:00
#include <rtthread.h>
2024-04-03 16:40:57 +08:00
#ifdef RT_USING_ULOG
#include <ulog.h>
#endif
2023-08-30 16:21:18 +08:00
2023-11-09 20:19:51 +08:00
#ifdef AIC_AB_SYSTEM_INTERFACE
#include <absystem.h>
#include <stdlib.h>
#include <stdio.h>
#include <dfs.h>
#include <dfs_fs.h>
2024-06-04 19:00:30 +08:00
#include <boot_param.h>
2023-11-09 20:19:51 +08:00
#endif
2023-08-30 16:21:18 +08:00
int main(void)
{
2023-11-09 20:19:51 +08:00
#ifdef AIC_AB_SYSTEM_INTERFACE
char target[32] = { 0 };
2024-06-04 19:00:30 +08:00
enum boot_device boot_dev = aic_get_boot_device();
2023-11-09 20:19:51 +08:00
2024-06-04 19:00:30 +08:00
if (boot_dev != BD_SDMC0) {
2023-11-09 20:19:51 +08:00
2024-06-04 19:00:30 +08:00
aic_ota_status_update();
aic_get_rodata_to_mount(target);
printf("Mount APP in blk %s\n", target);
if (dfs_mount(target, "/rodata", "elm", 0, 0) < 0)
printf("Failed to mount elm\n");
memset(target, 0, sizeof(target));
aic_get_data_to_mount(target);
printf("Mount APP in blk %s\n", target);
if (dfs_mount(target, "/data", "elm", 0, 0) < 0)
printf("Failed to mount elm\n");
}
2023-11-09 20:19:51 +08:00
#endif
2024-04-03 16:40:57 +08:00
#ifdef ULOG_USING_FILTER
ulog_global_filter_lvl_set(ULOG_OUTPUT_LVL);
#endif
2023-08-30 16:21:18 +08:00
return 0;
}