platform.c 1.0 KB
Newer Older
1 2 3 4 5 6 7 8
/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 */
M
Ming, Bai 已提交
9 10 11
#include <rtthread.h>
#include "board.h"

B
bernard 已提交
12 13
#include <shell.h>

mysterywolf's avatar
mysterywolf 已提交
14 15 16 17
#ifdef RT_USING_LIBC
#error "simulator does not support RT_USING_LIBC"
#endif

B
bernard 已提交
18
int platform_init(void)
M
Ming, Bai 已提交
19
{
20 21 22 23 24 25 26 27
#ifdef RT_USING_LWIP
#ifdef RT_USING_TAPNETIF
    tap_netif_hw_init();
#else
    pcap_netif_hw_init();
#endif
#endif

M
Ming, Bai 已提交
28 29 30 31 32 33 34 35 36 37 38 39 40
#ifdef RT_USING_DFS
    /* initialize sd card */
    rt_hw_sdcard_init();

#if defined(RT_USING_MTD_NAND)
    rt_hw_mtd_nand_init();
#endif

#if defined(RT_USING_MTD_NOR)
    sst25vfxx_mtd_init("nor", 0, RT_UINT32_MAX);
#endif

#endif /* RT_USING_DFS */
B
bernard 已提交
41

42 43
    return 0;
}
44
INIT_COMPONENT_EXPORT(platform_init);
45 46 47

int platform_post_init(void)
{
48
#ifdef PKG_USING_GUIENGINE
B
bernard 已提交
49 50 51 52 53 54 55 56
    {
        extern void rt_hw_sdl_start(void);
        extern int rtgui_system_server_init(void);

        rtgui_system_server_init();
        rt_hw_sdl_start();
    }
#endif
B
bernard 已提交
57
    return 0;
M
Ming, Bai 已提交
58
}
59
INIT_COMPONENT_EXPORT(platform_post_init);