application.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 FM4
  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. //finsh_system_init();
  27. finsh_set_device(RT_CONSOLE_DEVICE_NAME);
  28. /**< init led device */
  29. {
  30. extern void rt_led_hw_init(void);
  31. rt_led_hw_init();
  32. }
  33. {
  34. extern int demo_init(void);
  35. demo_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. /*@}*/