2012-01-15 21:17:09 +08:00
|
|
|
#include <rtthread.h>
|
|
|
|
#include "components_init.h"
|
|
|
|
|
2012-04-15 21:03:20 +08:00
|
|
|
#ifdef RT_USING_FINSH
|
|
|
|
#include <finsh.h>
|
|
|
|
#include <shell.h>
|
|
|
|
#endif
|
|
|
|
|
2012-01-15 21:17:09 +08:00
|
|
|
#ifdef RT_USING_LWIP
|
|
|
|
#include <lwip/sys.h>
|
|
|
|
#include <netif/ethernetif.h>
|
2012-04-15 21:03:20 +08:00
|
|
|
extern void lwip_system_init(void);
|
2012-01-15 21:17:09 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_DFS
|
2012-04-14 09:37:07 +08:00
|
|
|
#include <dfs_init.h>
|
|
|
|
#ifdef RT_USING_DFS_ELMFAT
|
|
|
|
#include <dfs_elm.h>
|
|
|
|
#endif
|
|
|
|
#ifdef RT_USING_DFS_NFS
|
|
|
|
#include <dfs_nfs.h>
|
|
|
|
#endif
|
|
|
|
#ifdef RT_USING_DFS_ROMFS
|
|
|
|
#include <dfs_romfs.h>
|
|
|
|
#endif
|
|
|
|
#ifdef RT_USING_DFS_DEVFS
|
|
|
|
#include <devfs.h>
|
|
|
|
#endif
|
|
|
|
#ifdef RT_USING_DFS_UFFS
|
|
|
|
#include <dfs_uffs.h>
|
|
|
|
#endif
|
|
|
|
#ifdef RT_USING_DFS_JFFS2
|
|
|
|
#include <dfs_jffs2.h>
|
|
|
|
#endif
|
|
|
|
#ifdef RT_USING_DFS_YAFFS2
|
|
|
|
#include <dfs_yaffs2.h>
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_NEWLIB
|
|
|
|
#include <libc.h>
|
|
|
|
#endif
|
|
|
|
#ifdef RT_USING_PTHREADS
|
|
|
|
#include <pthread.h>
|
2012-01-15 21:17:09 +08:00
|
|
|
#endif
|
|
|
|
|
2012-04-14 09:37:07 +08:00
|
|
|
/**
|
|
|
|
* RT-Thread Components Initialization
|
|
|
|
*/
|
2012-01-15 21:17:09 +08:00
|
|
|
void rt_components_init(void)
|
|
|
|
{
|
2012-04-14 09:37:07 +08:00
|
|
|
#ifdef RT_USING_MODULE
|
|
|
|
rt_system_module_init();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_FINSH
|
|
|
|
/* initialize finsh */
|
|
|
|
finsh_system_init();
|
|
|
|
finsh_set_device(RT_CONSOLE_DEVICE_NAME);
|
|
|
|
#endif
|
|
|
|
|
2012-01-15 21:17:09 +08:00
|
|
|
#ifdef RT_USING_LWIP
|
|
|
|
/* initialize lwip stack */
|
2012-07-10 17:52:45 +08:00
|
|
|
/* register ethernetif device */
|
|
|
|
eth_system_device_init();
|
2012-01-15 21:17:09 +08:00
|
|
|
|
2012-07-10 17:52:45 +08:00
|
|
|
/* initialize lwip system */
|
|
|
|
lwip_system_init();
|
|
|
|
rt_kprintf("TCP/IP initialized!\n");
|
2012-01-15 21:17:09 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_DFS
|
2012-04-14 09:37:07 +08:00
|
|
|
/* initialize the device file system */
|
2012-01-15 21:17:09 +08:00
|
|
|
dfs_init();
|
|
|
|
|
|
|
|
#ifdef RT_USING_DFS_ELMFAT
|
2012-07-10 17:52:45 +08:00
|
|
|
/* initialize the elm chan FatFS file system*/
|
2012-01-15 21:17:09 +08:00
|
|
|
elm_init();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(RT_USING_DFS_NFS) && defined(RT_USING_LWIP)
|
2012-04-14 09:37:07 +08:00
|
|
|
/* initialize NFSv3 client file system */
|
2012-01-15 21:17:09 +08:00
|
|
|
nfs_init();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_DFS_YAFFS2
|
2012-07-07 22:34:57 +08:00
|
|
|
dfs_yaffs2_init();
|
2012-01-15 21:17:09 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_DFS_UFFS
|
2012-07-07 22:34:57 +08:00
|
|
|
dfs_uffs_init();
|
2012-01-15 21:17:09 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_DFS_JFFS2
|
2012-07-07 22:34:57 +08:00
|
|
|
dfs_jffs2_init();
|
2012-01-15 21:17:09 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_DFS_ROMFS
|
2012-07-07 22:34:57 +08:00
|
|
|
dfs_romfs_init();
|
2012-01-15 21:17:09 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_DFS_DEVFS
|
|
|
|
devfs_init();
|
|
|
|
#endif
|
2012-04-14 09:37:07 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_NEWLIB
|
|
|
|
libc_system_init(RT_CONSOLE_DEVICE_NAME);
|
|
|
|
#endif
|
2012-01-15 21:17:09 +08:00
|
|
|
|
2012-04-14 09:37:07 +08:00
|
|
|
#ifdef RT_USING_PTHREADS
|
|
|
|
pthread_system_init();
|
2012-01-15 21:17:09 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_RTGUI
|
2012-06-12 20:49:25 +08:00
|
|
|
rtgui_system_server_init();
|
2012-01-15 21:17:09 +08:00
|
|
|
#endif
|
|
|
|
|
2012-07-07 22:34:57 +08:00
|
|
|
#ifdef RT_USING_USB_HOST
|
|
|
|
rt_usb_host_init();
|
|
|
|
#endif
|
|
|
|
|
2012-01-15 21:17:09 +08:00
|
|
|
return;
|
|
|
|
}
|