application.c 829 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. * 2014-01-02 xiaonong the first version for lpc408x
  9. */
  10. #include <rtthread.h>
  11. #ifdef RT_USING_FINSH
  12. #include <shell.h>
  13. #include <finsh.h>
  14. #endif
  15. /* thread phase init */
  16. void rt_init_thread_entry(void *parameter)
  17. {
  18. /* Initialization RT-Thread Components */
  19. #ifdef RT_USING_COMPONENTS_INIT
  20. rt_components_init();
  21. #elif defined(RT_USING_FINSH)
  22. finsh_system_init();
  23. #endif
  24. }
  25. int rt_application_init(void)
  26. {
  27. rt_thread_t tid;
  28. tid = rt_thread_create("init",
  29. rt_init_thread_entry, RT_NULL,
  30. 2048, RT_THREAD_PRIORITY_MAX / 3, 20);
  31. if (tid != RT_NULL) rt_thread_startup(tid);
  32. return 0;
  33. }