application.c 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. rt_hw_eth_init();
  25. }
  26. int rt_application_init(void)
  27. {
  28. rt_thread_t tid;
  29. /* create initialization thread */
  30. tid = rt_thread_create("init",
  31. rt_init_thread_entry, RT_NULL,
  32. 4096, RT_THREAD_PRIORITY_MAX/3, 20);
  33. if (tid != RT_NULL)
  34. rt_thread_startup(tid);
  35. return 0;
  36. }