Exemplo n.º 1
0
void rt_init_thread_entry(void* parameter)
{
#ifdef RT_USING_LWIP
	/* initialize eth interface */
	lpc_emac_hw_init();
#endif
	
#ifdef RT_USING_COMPONENTS_INIT
	/* initialization RT-Thread Components */
	rt_components_init();
#endif

	{
		extern rt_err_t mci_hw_init(const char *device_name);
		mci_hw_init("sd0");
	}	

    /* Filesystem Initialization */
#ifdef RT_USING_DFS
    {
#ifdef RT_USING_DFS_ELMFAT
        /* mount sd card fat partition 1 as root directory */
        if (dfs_mount("sd0", "/", "elm", 0, 0) == 0)
		{
			rt_kprintf("File System initialized!\n");
		
			#if (RT_DFS_ELM_USE_LFN != 0) && (defined RT_DFS_ELM_CODE_PAGE_FILE)
			{
                extern void ff_convert_init(void);
                ff_convert_init();
			}
			#endif
		
		}
        else
            rt_kprintf("File System initialzation failed!\n");
#endif
    }
#endif
	
    /* do some thing here. */
#if defined(RT_USING_DFS) && defined(RT_USING_LWIP)
	/* start ftp server */
	rt_kprintf("ftp server begin...\n");
	ftpd_start();
	rt_kprintf("ftp server started!!\n");
#endif
    
}
Exemplo n.º 2
0
void rt_init_thread_entry(void* parameter)
{
	/* initialize LCD drv for GUI */
	rtgui_lcd_init();

	/* Filesystem Initialization */
	mci_hw_init("sd0");
	/* 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");
		
		#if (RT_DFS_ELM_USE_LFN != 0) && (defined RT_DFS_ELM_CODE_PAGE_FILE)
        {
                extern void ff_convert_init(void);
                ff_convert_init();
        }
		#endif
	}
	else 
	{	
		rt_kprintf("File System initialzation failed!\n");
	}	

	/* initialize GUI system */
	rtgui_system_server_init();
	/* initialize keyboard */
	rt_hw_key_init();
	/* initialize touch */
	rt_hw_spi_init();
	rtgui_touch_hw_init();

    /* GUI examples initializtion */
	application_init();
	
	finsh_system_init();
}
Exemplo n.º 3
0
/* thread phase init */
void rt_init_thread_entry(void *parameter)
{
    /* Filesystem Initialization */
#ifdef RT_USING_DFS
    {
		extern void ff_convert_init();

        /* init the device filesystem */
        dfs_init();

        /* init the elm FAT filesystam*/
        elm_init();

        /* mount spi flash fat as root directory */
        if (dfs_mount("spi0", "/", "elm", 0, 0) == 0)
        {
            rt_kprintf("SPI File System initialized!\n");

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

#ifdef RT_DFS_ELM_USE_LFN
		ff_convert_init();
#endif
    }
#endif

    load_setup();

    /* RTGUI Initialization */
#ifdef RT_USING_RTGUI
    {
        extern void rt_hw_key_init(void);
        extern void remote_init(void);
		extern void rtgui_touch_hw_init(void);

        radio_rtgui_init();
        rt_hw_key_init();
		rtgui_touch_hw_init();
        remote_init();
    }
#endif

    /* set default setup */
    {
        extern void vol(uint16_t v);
        extern void brightness_set(unsigned int value);
        vol(radio_setup.default_volume);
        brightness_set(radio_setup.lcd_brightness);
    }

    /* start RTC */
    rt_hw_rtc_init();

    /* LwIP Initialization */
#ifdef RT_USING_LWIP
    {
        extern void lwip_sys_init(void);
        extern void rt_hw_dm9000_init(void);

        eth_system_device_init();

        /* register ethernetif device */
        rt_hw_dm9000_init();
        /* init all device */
        rt_device_init_all();

        /* init lwip system */
        lwip_sys_init();
        rt_kprintf("TCP/IP initialized!\n");
    }
#endif

#if STM32_EXT_SRAM
    /* init netbuf worker */
    net_buf_init(320 * 1024);
#endif

}
Exemplo n.º 4
0
/* thread phase init */
void rt_init_thread_entry(void *parameter)
{
    /* Filesystem Initialization */
#ifdef RT_USING_DFS
    {
		extern void ff_convert_init();

		/* init the device filesystem */
		dfs_init();

		/* init the elm FAT filesystam*/
		elm_init();

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

    /* RTGUI Initialization */
#ifdef RT_USING_RTGUI
    {
        extern void rt_hw_key_init(void);
        extern void remote_init(void);
		extern void rtgui_touch_hw_init(void);

        radio_rtgui_init();
        rt_hw_key_init();
		rtgui_touch_hw_init();
        remote_init();
		brightness_set(radio_setup.lcd_brightness);
		//PCM1770_VolumeSet(radio_setup.default_volume);
    }
#endif
	
    /* start RTC */
    rt_hw_rtc_init();

    /* LwIP Initialization */
#ifdef RT_USING_LWIP
    {
        extern void lwip_sys_init(void);
        extern void rt_hw_dm9000_init(void);

        eth_system_device_init();

        /* register ethernetif device */
        rt_hw_dm9000_init();
        /* init all device */
        rt_device_init_all();
		
        /* init lwip system */
        lwip_sys_init();
        rt_kprintf("TCP/IP initialized!\n");
    }
#endif

#if STM32_EXT_SRAM
    /* init netbuf worker */
    net_buf_init(320 * 1024);
#endif
	
	/* TODO(CXF): start ftp and agent */
	ftpd_start();
}