application.c 962 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. rt_kprintf("new");
  21. #ifdef RT_USING_LWIP
  22. cme_m7_eth_init();
  23. //set_if("e0", "192.168.3.99", "192.168.1.1", "255.255.255.0");
  24. #endif /* RT_USING_LWIP */
  25. }
  26. int rt_application_init()
  27. {
  28. rt_thread_t tid;
  29. tid = rt_thread_create("init",
  30. rt_init_thread_entry,
  31. RT_NULL,
  32. 2048,
  33. RT_THREAD_PRIORITY_MAX/3,
  34. 20);
  35. if (tid != RT_NULL)
  36. rt_thread_startup(tid);
  37. return 0;
  38. }
  39. /*@}*/