application.c 1008 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (c) 2006-2018, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2009-01-05 Bernard the first version
  9. * 2014-04-27 Bernard make code cleanup.
  10. */
  11. #include <board.h>
  12. #include <rtthread.h>
  13. #ifdef RT_USING_LWIP
  14. #include <lwip/sys.h>
  15. #include <lwip/api.h>
  16. #include <netif/ethernetif.h>
  17. #include "stm32f4xx_eth.h"
  18. #endif
  19. #ifdef RT_USING_FINSH
  20. #include <shell.h>
  21. #include <finsh.h>
  22. #endif
  23. #ifdef RT_USING_GDB
  24. #include <gdb_stub.h>
  25. #endif
  26. void rt_init_thread_entry(void* parameter)
  27. {
  28. /* initialization RT-Thread Components */
  29. rt_components_init();
  30. /* GDB STUB */
  31. #ifdef RT_USING_GDB
  32. gdb_set_device("uart6");
  33. gdb_start();
  34. #endif
  35. }
  36. int rt_application_init()
  37. {
  38. rt_thread_t tid;
  39. tid = rt_thread_create("init",
  40. rt_init_thread_entry, RT_NULL,
  41. 2048, RT_THREAD_PRIORITY_MAX/3, 20);
  42. if (tid != RT_NULL)
  43. rt_thread_startup(tid);
  44. return 0;
  45. }