application.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright (c) 2006-2018, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2009-01-05 Bernard the first version
  9. * 2014-04-27 Bernard make code cleanup.
  10. */
  11. #include <board.h>
  12. #include <rtthread.h>
  13. #include <drivers/mtd_nand.h>
  14. #include "finsh.h"
  15. #include "time.h"
  16. #ifdef RT_USING_DFS
  17. /* dfs init */
  18. #include <dfs.h>
  19. /* dfs filesystem:ELM filesystem init */
  20. #include <dfs_elm.h>
  21. /* dfs Filesystem APIs */
  22. #include <dfs_fs.h>
  23. #include <dfs_posix.h>
  24. #endif
  25. #ifdef RT_USING_LWIP
  26. #include <lwip/sys.h>
  27. #include <lwip/api.h>
  28. #include <netif/ethernetif.h>
  29. #include "drv_eth.h"
  30. #endif
  31. #ifdef RT_USING_GDB
  32. #include <gdb_stub.h>
  33. #endif
  34. #ifdef PKG_USING_GUIENGINE
  35. #include "rtgui_demo.h"
  36. #include <rtgui/driver.h>
  37. #endif
  38. //rt_module_t module_ptr;
  39. #define DATA_PATH "/Data"
  40. void rt_init_thread_entry(void* parameter)
  41. {
  42. /* initialization RT-Thread Components */
  43. #ifdef RT_USING_COMPONENTS_INIT
  44. rt_components_init();
  45. #endif
  46. }
  47. int rt_application_init()
  48. {
  49. rt_thread_t tid;
  50. tid = rt_thread_create("init",
  51. rt_init_thread_entry, RT_NULL,
  52. 2048, RT_THREAD_PRIORITY_MAX/3, 20);
  53. if (tid != RT_NULL)
  54. rt_thread_startup(tid);
  55. return 0;
  56. }