application.c 854 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. * 2012-02-13 mojingxian first version
  13. */
  14. #include "application.h"
  15. #include "board.h"
  16. #include "rtthread.h"
  17. void app_init_entry(void *parg)
  18. {
  19. parg = parg;
  20. rt_hw_core_timer_init();//start system tick in first thread.
  21. rt_hw_isr_install();
  22. }
  23. void rt_application_init(void)
  24. {
  25. rt_thread_t led_thread;
  26. #ifdef RT_USING_HEAP
  27. led_thread = rt_thread_create("init", app_init_entry, RT_NULL, 512, 200, 20);
  28. #endif
  29. if (led_thread != RT_NULL)
  30. {
  31. rt_thread_startup(led_thread);
  32. }
  33. }