application.c 1012 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * File : application.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2014, 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. * 2014-01-02 xiaonong the first version for lpc408x
  13. */
  14. #include <rtthread.h>
  15. #ifdef RT_USING_FINSH
  16. #include <shell.h>
  17. #include <finsh.h>
  18. #endif
  19. /* thread phase init */
  20. void rt_init_thread_entry(void *parameter)
  21. {
  22. /* Initialization RT-Thread Components */
  23. #ifdef RT_USING_COMPONENTS_INIT
  24. rt_components_init();
  25. #elif defined(RT_USING_FINSH)
  26. finsh_system_init();
  27. #endif
  28. }
  29. int rt_application_init(void)
  30. {
  31. rt_thread_t tid;
  32. tid = rt_thread_create("init",
  33. rt_init_thread_entry, RT_NULL,
  34. 2048, RT_THREAD_PRIORITY_MAX / 3, 20);
  35. if (tid != RT_NULL) rt_thread_startup(tid);
  36. return 0;
  37. }