application.c 921 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * File : application.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006, 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. #include <rtthread.h>
  15. #ifdef RT_USING_FINSH
  16. #include <finsh.h>
  17. #include <shell.h>
  18. #endif
  19. extern int demo_init(void);
  20. void rt_init_thread_entry(void* parameter)
  21. {
  22. #ifdef RT_USING_FINSH
  23. /* initialization finsh shell Component */
  24. finsh_system_init();
  25. #endif
  26. demo_init();
  27. }
  28. int rt_application_init()
  29. {
  30. rt_thread_t tid;
  31. tid = rt_thread_create("init",
  32. rt_init_thread_entry, RT_NULL,
  33. 2048, RT_THREAD_PRIORITY_MAX/3, 20);
  34. if (tid != RT_NULL)
  35. rt_thread_startup(tid);
  36. return 0;
  37. }