Exemplo n.º 1
0
static void thread_entry(void* parameter)
{
    /* File System Initialization */
#ifdef RT_USING_DFS
    {
        /* initialize the device file system */
        dfs_init();

#ifdef RT_USING_DFS_ELMFAT
        /* initialize the elm FAT file system*/
        elm_init();
#endif
#ifdef RT_USING_DFS_ROMFS
        /* initialize romfs */
        dfs_romfs_init();
#endif

        if (dfs_mount(RT_NULL, "/", "rom", 0, DFS_ROMFS_ROOT) == 0)
        {
            rt_kprintf("ROM File System initialized!\n");
            {
                do_init();
                rt_thread_delay(RT_TICK_PER_SECOND);
            }
        }
        else
            rt_kprintf("ROM File System initialzation failed!\n");
    }
#endif

    usbd_hw_init();
    /* set console and finsh to USB vcom */
#ifdef RT_USING_CONSOLE
    rt_console_set_device("vcom");
#endif
#ifdef RT_USING_FINSH
    finsh_set_device("vcom");
#endif
#ifdef RT_USING_USB_HOST
    rt_usb_host_init();
    /* register stm32 usb host controller driver */
    rt_hw_susb_init();

    rt_device_init_all();
#endif
}
Exemplo n.º 2
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
}
Exemplo n.º 3
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;
}