예제 #1
0
void init_thread(void* parameter)
{
	eth_system_device_init();
	lwip_system_init();
    
    dfs_init();
    elm_init();
    
    rt_hw_uart_init("uart0", 0);
    rt_console_set_device("uart0");
    rt_kprintf("rt-thread system start!\r\n");
    
    finsh_system_init();
    
    rt_hw_dflash_init("dflash0");
    dfs_mount("dflash0", "/", "elm", 0, 0);
    rt_hw_enet_phy_init();
    
    rt_kprintf("waitting for connection...");
    
    /* tcp server demo */
    extern void tcpserv(void* parameter);
    tcpserv(RT_NULL);
    
}
예제 #2
0
void init_tcpip_lwip_stack(void)
{
	extern void lwip_system_init(void);
	extern rt_err_t eth_system_device_init(void);

	/* register ethernetif device */
	eth_system_device_init();
	RT_APPS_INIT_DEBUG(("eth_system_device_init() succ!\n"));

	rt_hw_stm32_eth_init();
	RT_APPS_INIT_DEBUG(("func:%s, line:%u, eie:0x%x!\n", __FUNCTION__, __LINE__, enc28j60_read(EIE)));
	/* to assure Ethernet Phy work well */ //lihao
	//Ethernet_Security();
	RT_APPS_INIT_DEBUG(("func:%s, line:%u!\n", __FUNCTION__, __LINE__));

	/* re-init device driver */
	rt_device_init_all();
	RT_APPS_INIT_DEBUG(("func:%s, line:%u, eie:0x%x!\n", __FUNCTION__, __LINE__, enc28j60_read(EIE)));

	/* init lwip system */
	lwip_system_init();
	RT_APPS_INIT_LOG(("TCP/IP initialized, eie:0x%x!\n", enc28j60_read(EIE)));

	/* init net apps */
#if RT_USING_HTTPSERVER_RAW
	httpd_init();
#endif

#if RT_USING_TELNETD
	telnetd_init();
#endif
}
void rt_init_thread_entry(void* parameter)
{
    {
        extern void rt_platform_init(void);
        rt_platform_init();
    }

    /* Filesystem Initialization */
#if defined(RT_USING_DFS) && defined(RT_USING_DFS_ELMFAT)
	/* initialize the device file system */
	dfs_init();

	/* initialize the elm chan FatFS file system*/
	elm_init();
    
    /* mount sd card fat partition 1 as root directory */
    if (dfs_mount("sd0", "/", "elm", 0, 0) == 0)
    {
        rt_kprintf("File System initialized!\n");
    }
    else
    {
        rt_kprintf("File System initialzation failed!\n");
    }
#endif /* RT_USING_DFS && RT_USING_DFS_ELMFAT */

#ifdef RT_USING_LWIP
	/* initialize lwip stack */
	/* register ethernetif device */
	eth_system_device_init();

	/* initialize lwip system */
	lwip_system_init();
	rt_kprintf("TCP/IP initialized!\n");
#endif

#ifdef RT_USING_FINSH
	/* initialize finsh */
	finsh_system_init();
	finsh_set_device(RT_CONSOLE_DEVICE_NAME);
#endif
        //led_tog_init();
}
예제 #4
0
/* thread phase init */
void rt_init_thread_entry(void *parameter)
{
	/* initialize platform */
	platform_init();

#ifdef RT_USING_LWIP
    /* register Ethernet interface device */
    lpc17xx_emac_hw_init();

    /* initialize lwip stack */
	/* register ethernetif device */
	eth_system_device_init();

	/* initialize lwip system */
	lwip_system_init();
	rt_kprintf("TCP/IP initialized!\n");
#endif

    /* Filesystem Initialization */
#ifdef RT_USING_DFS
    rt_hw_sdcard_init();

	/* initialize the device file system */
	dfs_init();

#ifdef RT_USING_DFS_ELMFAT
	/* initialize the elm chan FatFS file system*/
	elm_init();
#endif

    /* mount sd card fat partition 1 as root directory */
    if (dfs_mount("sd0", "/", "elm", 0, 0) == 0)
    	rt_kprintf("File System initialized!\n");
    else
    	rt_kprintf("File System init failed!\n");
#endif

#ifdef RT_USING_FINSH
	/* initialize finsh */
	finsh_system_init();
	finsh_set_device(RT_CONSOLE_DEVICE_NAME);
#endif
}
예제 #5
0
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
}
예제 #6
0
/**
 * RT-Thread Components Initialization
 */
void rt_components_init(void)
{
#ifndef _MSC_VER
#ifdef RT_DEBUG_INIT
	int result;
	const struct rt_init_desc *desc;

	rt_kprintf("do components intialization.\n");
	for (desc = &__rt_init_desc_rti_board_end; desc < &__rt_init_desc_rti_end; desc ++)
	{
		rt_kprintf("initialize %s", desc->fn_name);
		result = desc->fn();
		rt_kprintf(":%d done\n", result);
	}
#else
    const init_fn_t *fn_ptr;
    
    for (fn_ptr = &__rt_init_rti_board_end; fn_ptr < &__rt_init_rti_end; fn_ptr ++)
    {
        (*fn_ptr)();
    }
#endif
#else
#ifdef RT_USING_MODULE
    rt_system_module_init();
#endif

#ifdef RT_USING_FINSH
	/* initialize finsh */
	finsh_system_init();
	finsh_set_device(RT_CONSOLE_DEVICE_NAME);
#endif

#ifdef RT_USING_LWIP
	/* initialize lwip stack */
	/* register ethernetif device */
	eth_system_device_init();

	/* initialize lwip system */
	lwip_system_init();
	rt_kprintf("TCP/IP initialized!\n");
#endif

#ifdef RT_USING_DFS
	/* initialize the device file system */
	dfs_init();

#ifdef RT_USING_DFS_ELMFAT
	/* initialize the elm chan FatFS file system*/
	elm_init();
#endif

#if defined(RT_USING_DFS_NFS) && defined(RT_USING_LWIP)
	/* initialize NFSv3 client file system */
	nfs_init();
#endif

#ifdef RT_USING_DFS_YAFFS2
	dfs_yaffs2_init();
#endif

#ifdef RT_USING_DFS_UFFS
	dfs_uffs_init();
#endif

#ifdef RT_USING_DFS_JFFS2
	dfs_jffs2_init();
#endif

#ifdef RT_USING_DFS_ROMFS
	dfs_romfs_init();
#endif

#ifdef RT_USING_DFS_RAMFS
	dfs_ramfs_init();
#endif

#ifdef RT_USING_DFS_DEVFS
	devfs_init();
#endif
#endif /* end of RT_USING_DFS */

#ifdef RT_USING_NEWLIB
	libc_system_init(RT_CONSOLE_DEVICE_NAME);
#else
	/* the pthread system initialization will be initiallized in libc */
#ifdef RT_USING_PTHREADS 
	pthread_system_init();
#endif
#endif

#ifdef RT_USING_RTGUI
	rtgui_system_server_init();
#endif

#ifdef RT_USING_USB_HOST
	rt_usb_host_init();
#endif
#endif
}
예제 #7
0
void rt_init_thread_entry(void* parameter)
{
	platform_init();
	
/* Filesystem Initialization */
#ifdef RT_USING_DFS
	{
		/* init the device filesystem */
		dfs_init();

#if defined(RT_USING_DFS_ELMFAT)
		/* init the elm chan FatFs filesystam*/
		elm_init();
#endif

#if defined(RT_USING_DFS_ROMFS)
		dfs_romfs_init();
		if (dfs_mount(RT_NULL, "/rom", "rom", 0, &romfs_root) == 0)
		{
			rt_kprintf("ROM File System initialized!\n");
		}
		else
			rt_kprintf("ROM File System initialzation failed!\n");
#endif

#if defined(RT_USING_DFS_DEVFS)
		devfs_init();
		if (dfs_mount(RT_NULL, "/dev", "devfs", 0, 0) == 0)
			rt_kprintf("Device File System initialized!\n");
		else
			rt_kprintf("Device File System initialzation failed!\n");

		#ifdef RT_USING_NEWLIB
		/* init libc */
		libc_system_init(RT_CONSOLE_DEVICE_NAME);
		#endif
#endif

#if defined(RT_USING_DFS_UFFS)
	{
		/* init the uffs filesystem */
		dfs_uffs_init();

		/* mount flash device as flash directory */
		if(dfs_mount("nand0", "/nand0", "uffs", 0, 0) == 0)
			rt_kprintf("UFFS File System initialized!\n");
		else
			rt_kprintf("UFFS File System initialzation failed!\n");
	}
#endif

#ifdef RT_USING_I2C
	{
		rt_i2c_core_init();
		davinci_i2c_init("I2C1");
	}
#endif

#ifdef RT_USING_SPI
	{
		rt_hw_spi_init();
	}
#endif

#ifdef RT_USING_SDIO
	rt_mmcsd_core_init();
	rt_mmcsd_blk_init();
	rt_hw_mmcsd_init();
	rt_thread_delay(RT_TICK_PER_SECOND*2);
	/* mount sd card fat partition 1 as root directory */
		if (dfs_mount("sd0", "/", "elm", 0, 0) == 0)
		{
			rt_kprintf("File System initialized!\n");
		}
		else
			rt_kprintf("File System initialzation failed!%d\n", rt_get_errno());
#endif
	}
#endif

#ifdef RT_USING_LWIP
	{
		/* register ethernetif device */
		eth_system_device_init();
		rt_hw_davinci_emac_init();
		/* init lwip system */
		lwip_system_init();
	}
#endif

}
예제 #8
0
void lwip_sys_init(void)
{
    lwip_system_init();
}
예제 #9
0
/**
 * RT-Thread Components Initialization
 */
void rt_components_init(void)
{
#ifdef RT_USING_MODULE
    rt_system_module_init();
#endif

#ifdef RT_USING_FINSH
    /* initialize finsh */
    finsh_system_init();
    finsh_set_device(RT_CONSOLE_DEVICE_NAME);
#endif

#ifdef RT_USING_LWIP
    /* initialize lwip stack */
    /* register ethernetif device */
    eth_system_device_init();

    /* initialize lwip system */
    lwip_system_init();
    rt_kprintf("TCP/IP initialized!\n");
#endif

#ifdef RT_USING_DFS
    /* initialize the device file system */
    dfs_init();

    #ifdef RT_USING_DFS_ELMFAT
    /* initialize the elm chan FatFS file system*/
    elm_init();
    #endif

    #if defined(RT_USING_DFS_NFS) && defined(RT_USING_LWIP)
    /* initialize NFSv3 client file system */
    nfs_init();
    #endif

    #ifdef RT_USING_DFS_YAFFS2
    dfs_yaffs2_init();
    #endif

    #ifdef RT_USING_DFS_UFFS
    dfs_uffs_init();
    #endif

    #ifdef RT_USING_DFS_JFFS2
    dfs_jffs2_init();
    #endif

    #ifdef RT_USING_DFS_ROMFS
    dfs_romfs_init();
    #endif

    #ifdef RT_USING_DFS_DEVFS
    devfs_init();
    #endif
#endif /* end of RT_USING_DFS */

#ifdef RT_USING_NEWLIB
    libc_system_init(RT_CONSOLE_DEVICE_NAME);
#else
    /* the pthread system initialization will be initiallized in libc */
    #ifdef RT_USING_PTHREADS 
    pthread_system_init();
    #endif
#endif

#ifdef RT_USING_RTGUI
    rtgui_system_server_init();
#endif

#ifdef RT_USING_USB_HOST
    rt_usb_host_init();
#endif

    return;
}
/**
 * RT-Thread Components Initialization
 */
void rt_components_init(void)
{
#ifdef RT_USING_MODULE
	rt_system_module_init();
#endif

#ifdef RT_USING_FINSH
	/* initialize finsh */
	finsh_system_init();
	finsh_set_device(RT_CONSOLE_DEVICE_NAME);
#endif

#ifdef RT_USING_LWIP
	/* initialize lwip stack */
    /* register ethernetif device */
    eth_system_device_init();

    /* initialize lwip system */
    lwip_system_init();
    rt_kprintf("TCP/IP initialized!\n");
#endif

#ifdef RT_USING_DFS
	/* initialize the device file system */
	dfs_init();

#ifdef RT_USING_DFS_ELMFAT
	/* initialize the elm chan FatFS file systam*/
	elm_init();
#endif

#if defined(RT_USING_DFS_NFS) && defined(RT_USING_LWIP)
	extern void nfs_init(void);
	/* initialize NFSv3 client file system */
	nfs_init();
#endif

#ifdef RT_USING_DFS_YAFFS2
	yaffs2_init();
#endif

#ifdef RT_USING_DFS_UFFS
	uffs_init();
#endif

#ifdef RT_USING_DFS_JFFS2
	jffs2_init();
#endif

#ifdef RT_USING_DFS_ROMFS
	romfs_init();
#endif

#ifdef RT_USING_DFS_DEVFS
	devfs_init();
#endif
#endif

#ifdef RT_USING_NEWLIB
	libc_system_init(RT_CONSOLE_DEVICE_NAME);
#endif

#ifdef RT_USING_PTHREADS 
	pthread_system_init();
#endif

#ifdef RT_USING_RTGUI
	rtgui_system_server_init();
#endif

	return;
}
void rt_init_thread_entry(void* parameter)
{
    {
        extern void rt_platform_init(void);
        rt_platform_init();
    }

    /* Filesystem Initialization */
#if defined(RT_USING_DFS) && defined(RT_USING_DFS_ELMFAT)
	/* initialize the device file system */
	dfs_init();

	/* initialize the elm chan FatFS file system*/
	elm_init();
    
    /* mount sd card fat partition 1 as root directory */
    if (dfs_mount("sd0", "/", "elm", 0, 0) == 0)
    {
        rt_kprintf("File System initialized!\n");
    }
    else
    {
        rt_kprintf("File System initialzation failed!\n");
    }
#endif /* RT_USING_DFS && RT_USING_DFS_ELMFAT */

#ifdef RT_USING_LWIP
	/* initialize lwip stack */
	/* register ethernetif device */
	eth_system_device_init();

	/* initialize lwip system */
	lwip_system_init();
	rt_kprintf("TCP/IP initialized!\n");
#endif

#ifdef RT_USING_FINSH
	/* initialize finsh */
	finsh_system_init();
	finsh_set_device(RT_CONSOLE_DEVICE_NAME);
#endif
        
#ifdef RT_USING_RTGUI
	{
                
		rt_device_t device;
		struct rt_device_rect_info info;
                
                extern int rtgui_system_server_init(void);
                rtgui_system_server_init();
                
		device = rt_device_find("lcd");
		/* re-set graphic device */
		rtgui_graphic_set_device(device);
		
		rtgui_system_server_init();

		/* ´¥ÃþÆÁУ׼
                calibration();*/
                               
		/* ²âÊÔ´¥ÃþÆÁ°´Å¥ ¼°¼òÒ×¼ÆËãÆ÷
		ui_button();*/
                               
                /*ÔËÐÐdemo */
                application_init();           
                
	}
#endif        

}