1
0
Эх сурвалжийг харах

bsp/stm32f10x/touch.c: better naming

Rename flag to touched_down.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1788 bbd45198-f89e-11dd-88c7-29a3b14d5316
chaos.proton@gmail.com 13 жил өмнө
parent
commit
44b91706e2
1 өөрчлөгдсөн 4 нэмэгдсэн , 4 устгасан
  1. 4 4
      bsp/stm32f10x/touch.c

+ 4 - 4
bsp/stm32f10x/touch.c

@@ -186,9 +186,9 @@ static void rtgui_touch_calculate()
     }
 }
 
-static unsigned int flag = 0;
 void touch_timeout(void* parameter)
 {
+    static unsigned int touched_down = 0;
     struct rtgui_event_mouse emouse;
     static struct _touch_previous
     {
@@ -210,7 +210,7 @@ void touch_timeout(void* parameter)
         /* stop timer */
         rt_timer_stop(touch->poll_timer);
         rt_kprintf("touch up: (%d, %d)\n", emouse.x, emouse.y);
-        flag = 0;
+        touched_down = 0;
 
         if ((touch->calibrating == RT_TRUE) && (touch->calibration_func != RT_NULL))
         {
@@ -221,7 +221,7 @@ void touch_timeout(void* parameter)
     }
     else
     {
-        if(flag == 0)
+        if(touched_down == 0)
         {
             int tmer = RT_TICK_PER_SECOND/20 ;
             /* calculation */
@@ -241,7 +241,7 @@ void touch_timeout(void* parameter)
             emouse.button = (RTGUI_MOUSE_BUTTON_LEFT |RTGUI_MOUSE_BUTTON_DOWN);
 
 //            rt_kprintf("touch down: (%d, %d)\n", emouse.x, emouse.y);
-            flag = 1;
+            touched_down = 1;
             rt_timer_control(touch->poll_timer , RT_TIMER_CTRL_SET_TIME , &tmer);
         }
         else