From b300351874b928f5e4833143d4fbb87f940c3828 Mon Sep 17 00:00:00 2001 From: "bernard.xiong@gmail.com" Date: Thu, 18 Nov 2010 12:33:52 +0000 Subject: remove RT-Thread/GUI dependence. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1062 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- bsp/dev3210/application.c | 53 ++++------------------------------------------- bsp/dev3210/lnn800x480.c | 4 ++-- bsp/dev3210/rtconfig.h | 2 +- 3 files changed, 7 insertions(+), 52 deletions(-) (limited to 'bsp') diff --git a/bsp/dev3210/application.c b/bsp/dev3210/application.c index 4400f2caf0..0d2fe9cbdf 100644 --- a/bsp/dev3210/application.c +++ b/bsp/dev3210/application.c @@ -50,12 +50,15 @@ void thread_test() } FINSH_FUNCTION_EXPORT(thread_test, test thread!!); +#ifdef RT_USING_RTGUI #include #include #include +#endif int rt_application_init() { +#ifdef RT_USING_RTGUI rtgui_rect_t rect; rtgui_system_server_init(); @@ -76,57 +79,9 @@ int rt_application_init() rtgui_panel_set_default_focused("main"); rt_hw_lcd_init(); - - /* init example workbench */ - // workbench_init(); +#endif return 0; } -/* key simulator */ -static struct rtgui_event_kbd kbd_event; -void key_simulator(int key) -{ - /* init keyboard event */ - RTGUI_EVENT_KBD_INIT(&kbd_event); - kbd_event.mod = RTGUI_KMOD_NONE; - kbd_event.unicode = 0; - kbd_event.type = RTGUI_KEYDOWN; - kbd_event.key = key; - - /* post down event */ - rtgui_server_post_event(&(kbd_event.parent), sizeof(kbd_event)); - - /* delay to post up event */ - rt_thread_delay(50); - - /* post up event */ - kbd_event.type = RTGUI_KEYUP; - rtgui_server_post_event(&(kbd_event.parent), sizeof(kbd_event)); -} - -void left() -{ - key_simulator(RTGUIK_LEFT); -} -FINSH_FUNCTION_EXPORT(left, left key); - -void right() -{ - key_simulator(RTGUIK_LEFT); -} -FINSH_FUNCTION_EXPORT(right, right key); - -void down() -{ - key_simulator(RTGUIK_DOWN); -} -FINSH_FUNCTION_EXPORT(down, down key); - -void up() -{ - key_simulator(RTGUI_KEYUP); -} -FINSH_FUNCTION_EXPORT(up, up key); - /*@}*/ diff --git a/bsp/dev3210/lnn800x480.c b/bsp/dev3210/lnn800x480.c index 380034de84..be8a187aa5 100644 --- a/bsp/dev3210/lnn800x480.c +++ b/bsp/dev3210/lnn800x480.c @@ -13,6 +13,7 @@ */ #include +#ifdef RT_USING_RTGUI #include #include #include @@ -171,10 +172,8 @@ void lcd_init() rt_kprintf("HVLEN 0x%08x\n", LCD_HVLEN); rt_kprintf("HSB_MISC 0x%08x\n", HSB_MISC_REG); -#ifdef RT_USING_RTGUI /* add lcd driver into graphic driver */ rtgui_graphic_driver_add(&_rtgui_lcd_driver); -#endif } FINSH_FUNCTION_EXPORT(lcd_init, init lcd); @@ -182,3 +181,4 @@ void rt_hw_lcd_init() { lcd_init(); } +#endif diff --git a/bsp/dev3210/rtconfig.h b/bsp/dev3210/rtconfig.h index 7b8b32600f..4df6acb53d 100644 --- a/bsp/dev3210/rtconfig.h +++ b/bsp/dev3210/rtconfig.h @@ -130,7 +130,7 @@ #define RT_LWIP_ETHTHREAD_STACKSIZE 512 /* SECTION: RT-Thread/GUI */ -#define RT_USING_RTGUI +/* #define RT_USING_RTGUI */ /* name length of RTGUI object */ #define RTGUI_NAME_MAX 12 -- cgit v1.3.1