application.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. void rt_init_thread_entry(void *parameter)
  21. {
  22. #ifdef RT_USING_COMPONENTS_INIT
  23. /* initialization RT-Thread Components */
  24. rt_components_init();
  25. #endif
  26. #ifdef RT_USING_FINSH
  27. finsh_set_device(RT_CONSOLE_DEVICE_NAME);
  28. #endif /* RT_USING_FINSH */
  29. /**< init led device */
  30. {
  31. extern void rt_led_hw_init(void);
  32. rt_led_hw_init();
  33. }
  34. }
  35. int rt_application_init()
  36. {
  37. rt_thread_t tid;
  38. tid = rt_thread_create("init",
  39. rt_init_thread_entry, RT_NULL,
  40. 2048, 8, 20);
  41. if (tid != RT_NULL) rt_thread_startup(tid);
  42. return 0;
  43. }
  44. /*@}*/