application.c 1022 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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-02-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. while(1)
  23. {
  24. rt_hw_led_on(LED1);
  25. rt_hw_led_off(LED2);
  26. rt_thread_delay(100);
  27. rt_hw_led_off(LED1);
  28. rt_hw_led_on(LED2);
  29. rt_thread_delay(100);
  30. }
  31. }
  32. int rt_application_init()
  33. {
  34. rt_thread_t init_thread;
  35. init_thread = rt_thread_create("init", rt_init_thread_entry, RT_NULL, 1024, 21, 20);
  36. if(init_thread != RT_NULL)
  37. rt_thread_startup(init_thread);
  38. return 0;
  39. }
  40. /*@}*/