summaryrefslogtreecommitdiff
path: root/components/init
diff options
context:
space:
mode:
author[email protected] <[email protected]>2012-09-20 05:09:02 +0000
committer[email protected] <[email protected]>2012-09-20 05:09:02 +0000
commitf7e61043975dbf341c284c40e26bad5d1ee01f15 (patch)
tree4ac8e4eb8dec9c85ed0d2f32ea1696bc695f6e32 /components/init
parentb07bd9b0305b089a41ce571087241e8b63284a4e (diff)
Rename components_init.c/.h to components.c/.h.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2295 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/init')
-rw-r--r--components/init/SConscript16
-rw-r--r--components/init/components.c (renamed from components/init/components_init.c)218
-rw-r--r--components/init/components.h89
-rw-r--r--components/init/components_init.h15
4 files changed, 191 insertions, 147 deletions
diff --git a/components/init/SConscript b/components/init/SConscript
index 522266c5e8..261065dd52 100644
--- a/components/init/SConscript
+++ b/components/init/SConscript
@@ -1,8 +1,8 @@
-from building import *
-
-cwd = GetCurrentDir()
-src = Glob('*.c')
-CPPPATH = [cwd]
-group = DefineGroup('Components', src, depend = ['RT_USING_COMPONENTS_INIT'], CPPPATH = CPPPATH)
-
-Return('group')
+from building import *
+
+cwd = GetCurrentDir()
+src = Glob('*.c')
+CPPPATH = [cwd]
+group = DefineGroup('Components', src, depend = ['RT_USING_COMPONENTS_INIT'], CPPPATH = CPPPATH)
+
+Return('group')
diff --git a/components/init/components_init.c b/components/init/components.c
index c2b25bcd43..01cd117017 100644
--- a/components/init/components_init.c
+++ b/components/init/components.c
@@ -1,124 +1,94 @@
-#include <rtthread.h>
-#include "components_init.h"
-
-#ifdef RT_USING_FINSH
-#include <finsh.h>
-#include <shell.h>
-#endif
-
-#ifdef RT_USING_LWIP
-#include <lwip/sys.h>
-#include <netif/ethernetif.h>
-extern void lwip_system_init(void);
-#endif
-
-#ifdef RT_USING_DFS
-#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>
-#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 */
- /* register ethernetif device */
- eth_system_device_init();
-
- /* initialize lwip system */
- lwip_system_init();
- rt_kprintf("TCP/IP initialized!\n");
-#endif
-
-#ifdef RT_USING_DFS
- /* 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
-#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
- rtgui_system_server_init();
-#endif
-
-#ifdef RT_USING_USB_HOST
- rt_usb_host_init();
-#endif
-
- return;
-}
+/*
+ * 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.
+ */
+#include "components.h"
+
+/**
+ * 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 */
+ /* register ethernetif device */
+ eth_system_device_init();
+
+ /* initialize lwip system */
+ lwip_system_init();
+ rt_kprintf("TCP/IP initialized!\n");
+#endif
+
+#ifdef RT_USING_DFS
+ /* 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
+#endif /* end of RT_USING_DFS */
+
+#ifdef RT_USING_NEWLIB
+ libc_system_init(RT_CONSOLE_DEVICE_NAME);
+#endif
+
+#ifdef RT_USING_PTHREADS
+ pthread_system_init();
+#endif
+
+#ifdef RT_USING_RTGUI
+ rtgui_system_server_init();
+#endif
+
+#ifdef RT_USING_USB_HOST
+ rt_usb_host_init();
+#endif
+
+ return;
+}
diff --git a/components/init/components.h b/components/init/components.h
new file mode 100644
index 0000000000..9feb508f9e
--- /dev/null
+++ b/components/init/components.h
@@ -0,0 +1,89 @@
+/*
+ * File : components_init.h
+ * 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.h
+ * And all components related header files.
+ */
+
+#ifndef __COMPONENTS_INIT_H__
+#define __COMPONENTS_INIT_H__
+
+#include <rtthread.h>
+
+#ifdef RT_USING_FINSH
+#include <finsh.h>
+#include <shell.h>
+#endif
+
+#ifdef RT_USING_LWIP
+#include <lwip/sys.h>
+#include <netif/ethernetif.h>
+extern void lwip_system_init(void);
+#endif
+
+#ifdef RT_USING_DFS
+#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
+#ifdef RT_USING_DFS_ROMFS
+#include <dfs_romfs.h>
+#endif
+#endif
+
+#ifdef RT_USING_NEWLIB
+#include <libc.h>
+#endif
+#ifdef RT_USING_PTHREADS
+#include <pthread.h>
+#endif
+
+#ifdef RT_USING_MODULE
+#include <rtm.h>
+#endif
+
+#ifdef RT_USING_RTGUI
+#include <rtgui/rtgui_system.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Initializes components in RT-Thread
+ * notes: this function must be invoked in thread
+ */
+void rt_components_init(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/init/components_init.h b/components/init/components_init.h
deleted file mode 100644
index 39b4cdd4b9..0000000000
--- a/components/init/components_init.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * 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