Browse Source

initialize lwip and emac driver in the process context

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1625 bbd45198-f89e-11dd-88c7-29a3b14d5316
luohui2320@gmail.com 14 years ago
parent
commit
ce5eddd0a5
2 changed files with 12 additions and 9 deletions
  1. 12 0
      bsp/at91sam9260/application.c
  2. 0 9
      bsp/at91sam9260/startup.c

+ 12 - 0
bsp/at91sam9260/application.c

@@ -93,6 +93,18 @@ void rt_init_thread_entry(void* parameter)
 	}
 #endif
 
+#ifdef RT_USING_LWIP
+	{
+		/* register ethernetif device */
+		eth_system_device_init();
+		rt_hw_macb_init();
+		/* re-init device driver */
+		rt_device_init_all();
+		/* init lwip system */
+		lwip_sys_init();
+		rt_kprintf("TCP/IP initialized!\n");
+	}
+#endif
 
 }
 

+ 0 - 9
bsp/at91sam9260/startup.c

@@ -144,15 +144,6 @@ void rtthread_startup(void)
 	//rt_hw_sdcard_init();
 #endif
 
-#ifdef RT_USING_LWIP
-	/* register ethernetif device */
-	eth_system_device_init();
-	rt_hw_macb_init();
-	/* init lwip system */
-	lwip_sys_init();
-	rt_kprintf("TCP/IP initialized!\n");
-#endif
-
 	/*init all registed devices */
 	rt_device_init_all();
 #endif