diff --git a/bsp/simulator/applications/application.c b/bsp/simulator/applications/application.c index a6c9739830..2143ac5716 100644 --- a/bsp/simulator/applications/application.c +++ b/bsp/simulator/applications/application.c @@ -75,13 +75,16 @@ void rt_init_thread_entry(void* parameter) } #endif -#ifdef RT_USING_RTGUI +#if 0 { extern void application_init(void); rt_thread_delay(RT_TICK_PER_SECOND); application_init(); } #endif +#ifdef RT_USING_RTGUI + realtouch_ui_init(); +#endif } void rt_test_thread_entry(void* parameter) diff --git a/bsp/simulator/drivers/sdl_fb.c b/bsp/simulator/drivers/sdl_fb.c index 1db3c3cf9d..56b54b2891 100644 --- a/bsp/simulator/drivers/sdl_fb.c +++ b/bsp/simulator/drivers/sdl_fb.c @@ -4,8 +4,8 @@ #include #include -#define SDL_SCREEN_WIDTH 240 -#define SDL_SCREEN_HEIGHT 320 +#define SDL_SCREEN_WIDTH 800 +#define SDL_SCREEN_HEIGHT 480 struct sdlfb_device { @@ -31,10 +31,13 @@ static rt_err_t sdlfb_close(rt_device_t dev) SDL_Quit(); return RT_EOK; } + +static rt_mutex_t sdllock; static rt_err_t sdlfb_control(rt_device_t dev, rt_uint8_t cmd, void *args) { struct sdlfb_device *device; + rt_mutex_take(sdllock, RT_WAITING_FOREVER); device = (struct sdlfb_device*)dev; RT_ASSERT(device != RT_NULL); RT_ASSERT(device->screen != RT_NULL); @@ -91,7 +94,7 @@ static rt_err_t sdlfb_control(rt_device_t dev, rt_uint8_t cmd, void *args) } break; } - + rt_mutex_release(sdllock); return RT_EOK; } @@ -125,6 +128,8 @@ static void sdlfb_hw_init(void) SDL_WM_SetCaption ("RT-Thread/GUI Simulator", NULL); rt_device_register(RT_DEVICE(&_device), "sdl", RT_DEVICE_FLAG_RDWR); + + sdllock = rt_mutex_create("fb",RT_IPC_FLAG_FIFO); } #include @@ -156,6 +161,7 @@ static DWORD WINAPI sdl_loop(LPVOID lpParam) switch (event.type) { case SDL_MOUSEMOTION: +#if 0 { struct rtgui_event_mouse emouse; emouse.parent.type = RTGUI_EVENT_MOUSE_MOTION; @@ -171,6 +177,7 @@ static DWORD WINAPI sdl_loop(LPVOID lpParam) /* send event to server */ rtgui_server_post_event(&emouse.parent, sizeof(struct rtgui_event_mouse)); } +#endif break; case SDL_MOUSEBUTTONDOWN: