diff options
| author | [email protected] <[email protected]> | 2012-01-15 13:17:09 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2012-01-15 13:17:09 +0000 |
| commit | d74a78795d47e4dad821417fd5a5e532a74167cc (patch) | |
| tree | 36a216e14ff51be9188ee227646c284047bfe9fb /components | |
| parent | cb98336dc147b7446dba401b3d74cf0e4956830d (diff) | |
add components initialization (draft).
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1921 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components')
| -rw-r--r-- | components/init/SConscript | 8 | ||||
| -rw-r--r-- | components/init/components_init.c | 68 | ||||
| -rw-r--r-- | components/init/components_init.h | 15 |
3 files changed, 91 insertions, 0 deletions
diff --git a/components/init/SConscript b/components/init/SConscript new file mode 100644 index 0000000000..df773156cd --- /dev/null +++ b/components/init/SConscript @@ -0,0 +1,8 @@ +from building import *
+
+cwd = GetCurrentDir()
+src = Glob('*.c')
+CPPPATH = [cwd]
+group = DefineGroup('ComponentsInit', src, depend = ['RT_USING_COMPONENTS_INIT'], CPPPATH = CPPPATH)
+
+Return('group')
diff --git a/components/init/components_init.c b/components/init/components_init.c new file mode 100644 index 0000000000..a096ee074f --- /dev/null +++ b/components/init/components_init.c @@ -0,0 +1,68 @@ +#include <rtthread.h>
+#include "components_init.h"
+
+#ifdef RT_USING_LWIP
+#include <lwip/sys.h>
+#include <lwip/api.h>
+#include <netif/ethernetif.h>
+#endif
+
+#ifdef RT_USING_DFS
+#endif
+
+void rt_components_init(void)
+{
+#ifdef RT_USING_LWIP
+ /* initialize lwip stack */
+ extern void lwip_sys_init(void);
+
+ /* register ethernetif device */
+ eth_system_device_init();
+
+ /* initialize lwip system */
+ lwip_sys_init();
+ rt_kprintf("TCP/IP initialized!\n");
+#endif
+
+#ifdef RT_USING_DFS
+ /* initialize the device filesystem */
+ dfs_init();
+
+#ifdef RT_USING_DFS_ELMFAT
+ /* initialize the elm chan FatFS filesystam*/
+ elm_init();
+#endif
+
+#if defined(RT_USING_DFS_NFS) && defined(RT_USING_LWIP)
+ extern void nfs_init(void);
+ /* initialize NFSv3 client filesystem */
+ nfs_init();
+#endif
+
+#ifdef RT_USING_DFS_YAFFS2
+ yaffs2_init();
+#endif
+
+#ifdef RT_USING_DFS_UFFS
+ uffs_init();
+#endif
+
+#ifdef RT_USING_DFS_JFFS2
+ jffs2_init();
+#endif
+
+#ifdef RT_USING_DFS_ROMFS
+ romfs_init();
+#endif
+
+#ifdef RT_USING_DFS_DEVFS
+ devfs_init();
+#endif
+
+#endif
+
+#ifdef RT_USING_RTGUI
+#endif
+
+ return;
+}
diff --git a/components/init/components_init.h b/components/init/components_init.h new file mode 100644 index 0000000000..39b4cdd4b9 --- /dev/null +++ b/components/init/components_init.h @@ -0,0 +1,15 @@ +/*
+ * components_init.h
+ *
+ */
+
+#ifndef __COMPONENTS_INIT_H__
+#define __COMPONENTS_INIT_H__
+
+/**
+ * Initializes components in RT-Thread
+ * notes: this function must be invoked in thread
+ */
+void rt_components_init(void);
+
+#endif
|
