application.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. #include <board.h>
  16. #ifdef RT_USING_COMPONENTS_INIT
  17. #include <components.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. #endif
  26. #ifdef RT_USING_FINSH
  27. /* initialize finsh */
  28. finsh_system_init();
  29. finsh_set_device(FINSH_DEVICE_NAME);
  30. #endif
  31. }
  32. int rt_application_init(void)
  33. {
  34. rt_thread_t tid;
  35. tid = rt_thread_create("init",
  36. rt_init_thread_entry, RT_NULL,
  37. 2048, RT_THREAD_PRIORITY_MAX / 3, 20);
  38. if (tid != RT_NULL) rt_thread_startup(tid);
  39. return 0;
  40. }