1
0

application.c 895 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. /* initialization finsh shell Component */
  23. finsh_system_init();
  24. demo_init();
  25. }
  26. int rt_application_init()
  27. {
  28. rt_thread_t tid;
  29. tid = rt_thread_create("init",
  30. rt_init_thread_entry, RT_NULL,
  31. 2048, RT_THREAD_PRIORITY_MAX/3, 20);
  32. if (tid != RT_NULL)
  33. rt_thread_startup(tid);
  34. return 0;
  35. }