application.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. /**
  15. * @addtogroup STM32
  16. */
  17. /*@{*/
  18. #include <rtthread.h>
  19. #ifdef RT_USING_LWIP
  20. #include <lwip/sys.h>
  21. #include <lwip/api.h>
  22. #endif
  23. void rt_init_thread_entry(void* parameter)
  24. {
  25. /* LwIP Initialization */
  26. #ifdef RT_USING_LWIP
  27. {
  28. extern void lwip_sys_init(void);
  29. /* init lwip system */
  30. lwip_sys_init();
  31. rt_kprintf("TCP/IP initialized!\n");
  32. }
  33. #endif
  34. }
  35. int rt_application_init()
  36. {
  37. rt_thread_t init_thread;
  38. #if (RT_THREAD_PRIORITY_MAX == 32)
  39. init_thread = rt_thread_create("init",
  40. rt_init_thread_entry, RT_NULL,
  41. 2048, 8, 20);
  42. #else
  43. init_thread = rt_thread_create("init",
  44. rt_init_thread_entry, RT_NULL,
  45. 2048, 80, 20);
  46. #endif
  47. if (init_thread != RT_NULL)
  48. rt_thread_startup(init_thread);
  49. return 0;
  50. }
  51. /*@}*/