application.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * File : app.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://openlab.rt-thread.com/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2009-05-24 Bernard Add lwip init
  13. */
  14. /**
  15. * @addtogroup STM32
  16. */
  17. /*@{*/
  18. #include <rtthread.h>
  19. #ifdef RT_USING_LWIP
  20. #include <lwip/sys.h>
  21. #endif
  22. /* thread phase init */
  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. extern void httpd_init(void);
  30. /* init lwip system */
  31. lwip_sys_init();
  32. rt_kprintf("TCP/IP initialized!\n");
  33. httpd_init();
  34. rt_kprintf("httpd initialized!\n");
  35. }
  36. #endif
  37. }
  38. int rt_application_init()
  39. {
  40. rt_thread_t init_thread;
  41. init_thread = rt_thread_create("init",
  42. rt_init_thread_entry, RT_NULL,
  43. 2048, 8, 20);
  44. rt_thread_startup(init_thread);
  45. return 0;
  46. }
  47. /*@}*/