application.c 722 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * File : application.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-11-20 Bernard the first version
  13. */
  14. #include <rtthread.h>
  15. #include <components.h>
  16. void init_thread(void* parameter)
  17. {
  18. rt_components_init();
  19. }
  20. int rt_application_init()
  21. {
  22. rt_thread_t tid;
  23. tid = rt_thread_create("init", init_thread, RT_NULL,
  24. 1024, RT_THREAD_PRIORITY_MAX/3, 10);
  25. if (tid != RT_NULL) rt_thread_startup(tid);
  26. return 0;
  27. }