application.c 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * File : application.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2014, 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. * 2014-01-02 xiaonong the first version for lpc408x
  13. */
  14. #include <rtthread.h>
  15. #include <board.h>
  16. #include <components.h>
  17. /* thread phase init */
  18. void rt_init_thread_entry(void *parameter)
  19. {
  20. /* Initialization RT-Thread Components */
  21. #ifdef RT_USING_COMPONENTS_INIT
  22. rt_components_init();
  23. #endif
  24. #ifdef RT_USING_FINSH
  25. /* initialize finsh */
  26. finsh_system_init();
  27. finsh_set_device(FINSH_DEVICE_NAME);
  28. #endif
  29. }
  30. int rt_application_init(void)
  31. {
  32. rt_thread_t tid;
  33. tid = rt_thread_create("init",
  34. rt_init_thread_entry, RT_NULL,
  35. 2048, RT_THREAD_PRIORITY_MAX / 3, 20);
  36. if (tid != RT_NULL) rt_thread_startup(tid);
  37. return 0;
  38. }