application.c 938 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * File : application.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006-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-08-03 aozima first implementation
  13. */
  14. #include <board.h>
  15. #include <rtthread.h>
  16. #include <components.h>
  17. void rt_init_thread_entry(void* parameter)
  18. {
  19. rt_components_init();
  20. #ifdef RT_USING_LWIP
  21. cme_m7_eth_init();
  22. set_if("e0", "192.168.1.99", "192.168.1.1", "255.255.255.0");
  23. #endif /* RT_USING_LWIP */
  24. }
  25. int rt_application_init()
  26. {
  27. rt_thread_t tid;
  28. tid = rt_thread_create("init",
  29. rt_init_thread_entry,
  30. RT_NULL,
  31. 2048,
  32. RT_THREAD_PRIORITY_MAX/3,
  33. 20);
  34. if (tid != RT_NULL)
  35. rt_thread_startup(tid);
  36. return 0;
  37. }
  38. /*@}*/