application.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * File : application.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006-2012, RT-Thread Develop 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. * 2010-06-25 Bernard first version
  13. * 2011-08-08 lgnq modified for Loongson LS1B
  14. * 2015-07-06 chinesebear modified for Loongson LS1C
  15. */
  16. #include <rtthread.h>
  17. #include <components.h>
  18. #include "net/synopGMAC.h"
  19. #include <lwip/api.h>
  20. void rt_init_thread_entry(void *parameter)
  21. {
  22. /* initialization RT-Thread Components */
  23. rt_components_init();
  24. // Íø¿ÚEMAC³õʼ»¯
  25. rt_hw_eth_init();
  26. }
  27. int rt_application_init(void)
  28. {
  29. rt_thread_t tid;
  30. /* create initialization thread */
  31. tid = rt_thread_create("init",
  32. rt_init_thread_entry, RT_NULL,
  33. 4096, RT_THREAD_PRIORITY_MAX/3, 20);
  34. if (tid != RT_NULL)
  35. rt_thread_startup(tid);
  36. return 0;
  37. }