application.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * File : application.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2012, 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. * 2009-01-05 Bernard the first version
  13. */
  14. /**
  15. * @addtogroup LPC4330
  16. */
  17. /*@{*/
  18. #include <rtthread.h>
  19. #ifdef RT_USING_COMPONENTS_INIT
  20. #include <components.h>
  21. #endif
  22. #include "board_ngx_xplorer_18304330.h"
  23. static void rt_init_thread_entry(void *parameter)
  24. {
  25. Board_LED_Init();
  26. #ifdef RT_USING_COMPONENTS_INIT
  27. /* initialization RT-Thread Components */
  28. rt_components_init();
  29. #endif
  30. while (1)
  31. {
  32. Board_LED_Set(0, 1);
  33. rt_thread_delay(50);
  34. Board_LED_Set(0, 0);
  35. rt_thread_delay(50);
  36. }
  37. }
  38. void rt_application_init(void)
  39. {
  40. rt_thread_t tid;
  41. tid = rt_thread_create("init",
  42. rt_init_thread_entry,
  43. RT_NULL,
  44. 2048,
  45. RT_THREAD_PRIORITY_MAX / 3,
  46. 20);
  47. if (tid != RT_NULL)
  48. rt_thread_startup(tid);
  49. }
  50. /*@}*/