components.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * File : components.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2012, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2012-09-20 Bernard Change the name to components.c
  13. * And all components related header files.
  14. */
  15. #include "components.h"
  16. /**
  17. * RT-Thread Components Initialization
  18. */
  19. void rt_components_init(void)
  20. {
  21. #ifdef RT_USING_MODULE
  22. rt_system_module_init();
  23. #endif
  24. #ifdef RT_USING_FINSH
  25. /* initialize finsh */
  26. finsh_system_init();
  27. finsh_set_device(RT_CONSOLE_DEVICE_NAME);
  28. #endif
  29. #ifdef RT_USING_LWIP
  30. /* initialize lwip stack */
  31. /* register ethernetif device */
  32. eth_system_device_init();
  33. /* initialize lwip system */
  34. lwip_system_init();
  35. rt_kprintf("TCP/IP initialized!\n");
  36. #endif
  37. #ifdef RT_USING_DFS
  38. /* initialize the device file system */
  39. dfs_init();
  40. #ifdef RT_USING_DFS_ELMFAT
  41. /* initialize the elm chan FatFS file system*/
  42. elm_init();
  43. #endif
  44. #if defined(RT_USING_DFS_NFS) && defined(RT_USING_LWIP)
  45. /* initialize NFSv3 client file system */
  46. nfs_init();
  47. #endif
  48. #ifdef RT_USING_DFS_YAFFS2
  49. dfs_yaffs2_init();
  50. #endif
  51. #ifdef RT_USING_DFS_UFFS
  52. dfs_uffs_init();
  53. #endif
  54. #ifdef RT_USING_DFS_JFFS2
  55. dfs_jffs2_init();
  56. #endif
  57. #ifdef RT_USING_DFS_ROMFS
  58. dfs_romfs_init();
  59. #endif
  60. #ifdef RT_USING_DFS_DEVFS
  61. devfs_init();
  62. #endif
  63. #endif /* end of RT_USING_DFS */
  64. #ifdef RT_USING_NEWLIB
  65. libc_system_init(RT_CONSOLE_DEVICE_NAME);
  66. #endif
  67. #ifdef RT_USING_PTHREADS
  68. pthread_system_init();
  69. #endif
  70. #ifdef RT_USING_RTGUI
  71. rtgui_system_server_init();
  72. #endif
  73. #ifdef RT_USING_USB_HOST
  74. rt_usb_host_init();
  75. #endif
  76. return;
  77. }