application.c 957 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * File : application.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006-2012, RT-Thread Develop 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. * 2010-06-25 Bernard first version
  13. * 2011-08-08 lgnq modified for Loongson LS1B
  14. * 2015-07-06 chinesebear modified for Loongson LS1C
  15. */
  16. #include <rtthread.h>
  17. #include <components.h>
  18. void rt_init_thread_entry(void *parameter)
  19. {
  20. /* initialization RT-Thread Components */
  21. rt_components_init();
  22. }
  23. int rt_application_init(void)
  24. {
  25. rt_thread_t tid;
  26. /* create initialization thread */
  27. tid = rt_thread_create("init",
  28. rt_init_thread_entry, RT_NULL,
  29. 4096, RT_THREAD_PRIORITY_MAX/3, 20);
  30. if (tid != RT_NULL)
  31. rt_thread_startup(tid);
  32. return 0;
  33. }