simulator: init SDL after rt_components_init

SDL may use DFS to open files. It should be run after
rt_components_init.
This commit is contained in:
Grissiom 2013-08-31 16:46:36 +08:00
parent 3d0c0af371
commit 6563ae6cab
2 changed files with 6 additions and 5 deletions

View File

@ -30,6 +30,12 @@ void rt_init_thread_entry(void *parameter)
/* initialization RT-Thread Components */ /* initialization RT-Thread Components */
rt_components_init(); rt_components_init();
#ifdef RT_USING_RTGUI
/* start sdl thread to simulate an LCD. SDL may depend on DFS and should be
* called after rt_components_init. */
rt_hw_sdl_start();
#endif /* RT_USING_RTGUI */
#if defined(RT_USING_COMPONENTS_INIT) && defined(__GNUC__) && defined(RT_USING_FINSH) #if defined(RT_USING_COMPONENTS_INIT) && defined(__GNUC__) && defined(RT_USING_FINSH)
finsh_set_device(RT_CONSOLE_DEVICE_NAME); finsh_set_device(RT_CONSOLE_DEVICE_NAME);
#endif #endif

View File

@ -17,11 +17,6 @@ void rt_platform_init(void)
#endif /* RT_USING_DFS */ #endif /* RT_USING_DFS */
#ifdef RT_USING_RTGUI
/* start sdl thread to simulate an LCD */
rt_hw_sdl_start();
#endif /* RT_USING_RTGUI */
#ifdef _WIN32 #ifdef _WIN32
rt_thread_idle_sethook(rt_hw_win32_low_cpu); rt_thread_idle_sethook(rt_hw_win32_low_cpu);
#endif #endif