application.c 697 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. #ifdef RT_USING_FINSH
  14. #include "shell.h"
  15. #endif
  16. void rt_init_thread_entry(void* parameter)
  17. {
  18. #ifdef RT_USING_FINSH
  19. finsh_system_init();
  20. #endif
  21. }
  22. int rt_application_init()
  23. {
  24. rt_thread_t tid;
  25. tid = rt_thread_create("init",
  26. rt_init_thread_entry, RT_NULL,
  27. 2048, RT_THREAD_PRIORITY_MAX/3, 20);
  28. if (tid != RT_NULL)
  29. rt_thread_startup(tid);
  30. return 0;
  31. }