From 696653204d9636b25e6845e341e5cb32d72d6e4a Mon Sep 17 00:00:00 2001 From: "bernard.xiong@gmail.com" Date: Sat, 14 Apr 2012 01:37:07 +0000 Subject: [PATCH] add finsh component initialization. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2041 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- components/init/components_init.c | 57 ++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/components/init/components_init.c b/components/init/components_init.c index a096ee074..20b468387 100644 --- a/components/init/components_init.c +++ b/components/init/components_init.c @@ -8,14 +8,54 @@ #endif #ifdef RT_USING_DFS +#include +#ifdef RT_USING_DFS_ELMFAT +#include +#endif +#ifdef RT_USING_DFS_NFS +#include +#endif +#ifdef RT_USING_DFS_ROMFS +#include +#endif +#ifdef RT_USING_DFS_DEVFS +#include +#endif +#ifdef RT_USING_DFS_UFFS +#include +#endif +#ifdef RT_USING_DFS_JFFS2 +#include +#endif +#ifdef RT_USING_DFS_YAFFS2 +#include +#endif #endif +#ifdef RT_USING_NEWLIB +#include +#endif +#ifdef RT_USING_PTHREADS +#include +#endif + +/** + * RT-Thread Components Initialization + */ void rt_components_init(void) { +#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 + #ifdef RT_USING_LWIP /* initialize lwip stack */ - extern void lwip_sys_init(void); - /* register ethernetif device */ eth_system_device_init(); @@ -25,17 +65,17 @@ void rt_components_init(void) #endif #ifdef RT_USING_DFS - /* initialize the device filesystem */ + /* initialize the device file system */ dfs_init(); #ifdef RT_USING_DFS_ELMFAT - /* initialize the elm chan FatFS filesystam*/ + /* initialize the elm chan FatFS file systam*/ elm_init(); #endif #if defined(RT_USING_DFS_NFS) && defined(RT_USING_LWIP) extern void nfs_init(void); - /* initialize NFSv3 client filesystem */ + /* initialize NFSv3 client file system */ nfs_init(); #endif @@ -58,7 +98,14 @@ void rt_components_init(void) #ifdef RT_USING_DFS_DEVFS devfs_init(); #endif +#endif +#ifdef RT_USING_NEWLIB + libc_system_init(RT_CONSOLE_DEVICE_NAME); +#endif + +#ifdef RT_USING_PTHREADS + pthread_system_init(); #endif #ifdef RT_USING_RTGUI