void rt_init_thread_entry(void *parameter)
{
#ifdef RT_USING_COMPONENTS_INIT
    /* initialization RT-Thread Components */
    rt_components_init();
#endif

#ifdef RT_USING_LWIP
    /* initialize eth interface */
    rt_hw_wifi_init("spi01", MODE_STATION); // MODE_STATION MODE_SOFTAP
    rw009_join("you_AP", "you_passwd");
	set_if("w0", "192.168.1.30", "192.168.1.1", "255.255.255.0");
	
    //rt_hw_wifi_init("spi01", MODE_SOFTAP); // MODE_STATION MODE_SOFTAP
	//rw009_softap(WIFI_AP_SSID, WIFI_AP_PASS, WIFI_AP_SEC, WIFI_AP_CHANNEL);
	//dhcpd_start();
#endif /* RT_USING_LWIP */
}
void rt_init_thread_entry(void* parameter)
{
	rt_i2c_core_init();
	rt_hw_i2c_init();
	rt_hw_spi_init();
	//³õʼ»¯Ä£ÄâI2C
	//I2C_Soft_Init();
	rt_hw_mpu6050_init("i2c1", MPU6050_DEFAULT_ADDRESS);
	rt_motors_hw_init();
/* LwIP Initialization */
 #ifdef RT_USING_LWIP
 	{
 		extern void lwip_sys_init(void);

 		/* register ethernetif device */
 		eth_system_device_init();

 		/* initialize wifi interface */
 		rt_hw_wifi_init("spi10");

 		/* init lwip system */
 		lwip_system_init();
 		rt_kprintf("TCP/IP initialized!\n");
 		
 		set_if("w0","192.168.3.9","192.168.3.1","255.255.255.0");
 		rw009_join("rtthread_11n","rtthread_finsh");
 	}
 #endif
	apps_copter_init();
		
	
 #ifdef RT_USING_FINSH
 	/* init finsh */
 	finsh_system_init();
 	finsh_set_device(RT_CONSOLE_DEVICE_NAME);
 #endif
}