2012-09-20 13:09:02 +08:00
|
|
|
/*
|
|
|
|
* File : components.c
|
|
|
|
* This file is part of RT-Thread RTOS
|
|
|
|
* COPYRIGHT (C) 2012, RT-Thread Development Team
|
|
|
|
*
|
|
|
|
* The license and distribution terms for this file may be
|
|
|
|
* found in the file LICENSE in this distribution or at
|
|
|
|
* http://www.rt-thread.org/license/LICENSE
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2012-09-20 Bernard Change the name to components.c
|
|
|
|
* And all components related header files.
|
2012-12-23 14:16:14 +08:00
|
|
|
* 2012-12-23 Bernard fix the pthread initialization issue.
|
2012-09-20 13:09:02 +08:00
|
|
|
*/
|
2012-12-26 08:27:14 +08:00
|
|
|
|
2012-09-20 13:09:02 +08:00
|
|
|
#include "components.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* RT-Thread Components Initialization
|
|
|
|
*/
|
|
|
|
void rt_components_init(void)
|
|
|
|
{
|
|
|
|
#ifdef RT_USING_MODULE
|
2012-12-26 08:27:14 +08:00
|
|
|
rt_system_module_init();
|
2012-09-20 13:09:02 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_FINSH
|
2012-12-26 08:27:14 +08:00
|
|
|
/* initialize finsh */
|
|
|
|
finsh_system_init();
|
|
|
|
finsh_set_device(RT_CONSOLE_DEVICE_NAME);
|
2012-09-20 13:09:02 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_LWIP
|
2012-12-26 08:27:14 +08:00
|
|
|
/* initialize lwip stack */
|
|
|
|
/* register ethernetif device */
|
|
|
|
eth_system_device_init();
|
2012-09-20 13:09:02 +08:00
|
|
|
|
2012-12-26 08:27:14 +08:00
|
|
|
/* initialize lwip system */
|
|
|
|
lwip_system_init();
|
|
|
|
rt_kprintf("TCP/IP initialized!\n");
|
2012-09-20 13:09:02 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_DFS
|
2012-12-26 08:27:14 +08:00
|
|
|
/* initialize the device file system */
|
|
|
|
dfs_init();
|
|
|
|
|
|
|
|
#ifdef RT_USING_DFS_ELMFAT
|
|
|
|
/* initialize the elm chan FatFS file system*/
|
|
|
|
elm_init();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(RT_USING_DFS_NFS) && defined(RT_USING_LWIP)
|
|
|
|
/* initialize NFSv3 client file system */
|
|
|
|
nfs_init();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_DFS_YAFFS2
|
|
|
|
dfs_yaffs2_init();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_DFS_UFFS
|
|
|
|
dfs_uffs_init();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_DFS_JFFS2
|
|
|
|
dfs_jffs2_init();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_DFS_ROMFS
|
|
|
|
dfs_romfs_init();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_DFS_DEVFS
|
|
|
|
devfs_init();
|
|
|
|
#endif
|
2012-09-20 13:09:02 +08:00
|
|
|
#endif /* end of RT_USING_DFS */
|
|
|
|
|
|
|
|
#ifdef RT_USING_NEWLIB
|
2012-12-26 08:27:14 +08:00
|
|
|
libc_system_init(RT_CONSOLE_DEVICE_NAME);
|
2012-12-23 14:16:14 +08:00
|
|
|
#else
|
2012-12-26 08:27:14 +08:00
|
|
|
/* the pthread system initialization will be initiallized in libc */
|
|
|
|
#ifdef RT_USING_PTHREADS
|
|
|
|
pthread_system_init();
|
|
|
|
#endif
|
2012-12-23 14:16:14 +08:00
|
|
|
#endif
|
2012-09-20 13:09:02 +08:00
|
|
|
|
|
|
|
#ifdef RT_USING_RTGUI
|
2012-12-26 08:27:14 +08:00
|
|
|
rtgui_system_server_init();
|
2012-09-20 13:09:02 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_USB_HOST
|
2012-12-26 08:27:14 +08:00
|
|
|
rt_usb_host_init();
|
2012-09-20 13:09:02 +08:00
|
|
|
#endif
|
|
|
|
|
2012-12-26 08:27:14 +08:00
|
|
|
return;
|
2012-09-20 13:09:02 +08:00
|
|
|
}
|