From 4190cf58e0bbf841ac86a96cf90bb3df974adee9 Mon Sep 17 00:00:00 2001 From: qiuyiuestc Date: Thu, 25 Mar 2010 01:15:28 +0000 Subject: [PATCH] [mini2440]fix no down event problem, ugly implement,need consider move event git-svn-id: https://rt-thread.googlecode.com/svn/trunk@539 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- bsp/mini2440/touch.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/bsp/mini2440/touch.c b/bsp/mini2440/touch.c index 6fd971c1ca..0e3f245414 100644 --- a/bsp/mini2440/touch.c +++ b/bsp/mini2440/touch.c @@ -69,20 +69,20 @@ static struct s3c2410ts ts; #include void report_touch_input(int updown) { - long tmp; + long xp, yp; struct rtgui_event_mouse emouse; - ts.xp >>= ts.shift; - ts.yp >>= ts.shift; + xp = ts.xp >> ts.shift; + yp = ts.yp >> ts.shift; - ts.xp = 240 * (ts.xp-X_MIN)/(X_MAX-X_MIN); - ts.yp = 320 - (320*(ts.yp-Y_MIN)/(Y_MAX-Y_MIN)); + xp = 240 * (xp-X_MIN)/(X_MAX-X_MIN); + yp = 320 - (320*(yp-Y_MIN)/(Y_MAX-Y_MIN)); emouse.parent.type = RTGUI_EVENT_MOUSE_BUTTON; emouse.parent.sender = RT_NULL; - emouse.x = ts.xp; - emouse.y = ts.yp; + emouse.x = xp; + emouse.y = yp; /* set emouse button */ if (updown) @@ -95,7 +95,7 @@ void report_touch_input(int updown) } /* rt_kprintf("touch %s: ts.x: %d, ts.y: %d, count:%d\n", updown? "down" : "up", - ts.xp, ts.yp, ts.count); */ + xp, yp, ts.count); */ emouse.button |= RTGUI_MOUSE_BUTTON_LEFT; @@ -170,6 +170,7 @@ void s3c2410_intc_stylus_updown() if (ts.xp >= 0 && ts.yp >= 0) { #ifdef RT_USING_RTGUI + report_touch_input(1); report_touch_input(0); first_down_report = 1; #endif