components.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. * 2012-12-23 Bernard fix the pthread initialization issue.
  15. */
  16. #include "components.h"
  17. /**
  18. * RT-Thread Components Initialization
  19. */
  20. void rt_components_init(void)
  21. {
  22. #ifdef RT_USING_MODULE
  23. rt_system_module_init();
  24. #endif
  25. #ifdef RT_USING_FINSH
  26. /* initialize finsh */
  27. finsh_system_init();
  28. finsh_set_device(RT_CONSOLE_DEVICE_NAME);
  29. #endif
  30. #ifdef RT_USING_LWIP
  31. /* initialize lwip stack */
  32. /* register ethernetif device */
  33. eth_system_device_init();
  34. /* initialize lwip system */
  35. lwip_system_init();
  36. rt_kprintf("TCP/IP initialized!\n");
  37. #endif
  38. #ifdef RT_USING_DFS
  39. /* initialize the device file system */
  40. dfs_init();
  41. #ifdef RT_USING_DFS_ELMFAT
  42. /* initialize the elm chan FatFS file system*/
  43. elm_init();
  44. #endif
  45. #if defined(RT_USING_DFS_NFS) && defined(RT_USING_LWIP)
  46. /* initialize NFSv3 client file system */
  47. nfs_init();
  48. #endif
  49. #ifdef RT_USING_DFS_YAFFS2
  50. dfs_yaffs2_init();
  51. #endif
  52. #ifdef RT_USING_DFS_UFFS
  53. dfs_uffs_init();
  54. #endif
  55. #ifdef RT_USING_DFS_JFFS2
  56. dfs_jffs2_init();
  57. #endif
  58. #ifdef RT_USING_DFS_ROMFS
  59. dfs_romfs_init();
  60. #endif
  61. #ifdef RT_USING_DFS_DEVFS
  62. devfs_init();
  63. #endif
  64. #endif /* end of RT_USING_DFS */
  65. #ifdef RT_USING_NEWLIB
  66. libc_system_init(RT_CONSOLE_DEVICE_NAME);
  67. #else
  68. /* the pthread system initialization will be initiallized in libc */
  69. #ifdef RT_USING_PTHREADS
  70. pthread_system_init();
  71. #endif
  72. #endif
  73. #ifdef RT_USING_RTGUI
  74. rtgui_system_server_init();
  75. #endif
  76. #ifdef RT_USING_USB_HOST
  77. rt_usb_host_init();
  78. #endif
  79. return;
  80. }