application.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * File : application.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2009 - 2011, 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. * 2011-05-24 Bernard the first version
  13. */
  14. /**
  15. * @addtogroup FM3
  16. */
  17. /*@{*/
  18. #include <rtthread.h>
  19. #include "board.h"
  20. #ifdef RT_USING_COMPONENTS_INIT
  21. #include <components.h>
  22. #endif /* RT_USING_COMPONENTS_INIT */
  23. void rt_init_thread_entry(void *parameter)
  24. {
  25. #ifdef RT_USING_COMPONENTS_INIT
  26. /* initialization RT-Thread Components */
  27. rt_components_init();
  28. #endif
  29. #ifdef RT_USING_FINSH
  30. finsh_set_device(RT_CONSOLE_DEVICE_NAME);
  31. #endif /* RT_USING_FINSH */
  32. /**< init led device */
  33. {
  34. extern void rt_led_hw_init(void);
  35. rt_led_hw_init();
  36. }
  37. }
  38. int rt_application_init()
  39. {
  40. rt_thread_t tid;
  41. tid = rt_thread_create("init",
  42. rt_init_thread_entry, RT_NULL,
  43. 2048, 8, 20);
  44. if (tid != RT_NULL) rt_thread_startup(tid);
  45. return 0;
  46. }
  47. /*@}*/