diff options
Diffstat (limited to 'firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c')
-rw-r--r-- | firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c index 4def88c4f8..04acb71e45 100644 --- a/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c +++ b/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c | |||
@@ -110,16 +110,17 @@ inline bool button_hold(void) | |||
110 | 110 | ||
111 | int button_read_device(int *data) | 111 | int button_read_device(int *data) |
112 | { | 112 | { |
113 | static int old_data; | ||
113 | int button_read = BUTTON_NONE; | 114 | int button_read = BUTTON_NONE; |
114 | short touch_x, touch_y, touch_z1, touch_z2; | 115 | short touch_x, touch_y, touch_z1, touch_z2; |
115 | static bool hold_button_old = false; | 116 | static bool hold_button_old = false; |
116 | 117 | ||
117 | *data = 0; | 118 | *data = old_data; |
118 | 119 | ||
119 | /* Handle touchscreen */ | 120 | /* Handle touchscreen */ |
120 | if (tsc2100_read_touch(&touch_x, &touch_y, &touch_z1, &touch_z2)) | 121 | if (tsc2100_read_touch(&touch_x, &touch_y, &touch_z1, &touch_z2)) |
121 | { | 122 | { |
122 | *data = touch_to_pixels(&touch_x, &touch_y); | 123 | old_data = *data = touch_to_pixels(&touch_x, &touch_y); |
123 | button_read |= touchscreen_to_pixels(touch_x, touch_y, data); | 124 | button_read |= touchscreen_to_pixels(touch_x, touch_y, data); |
124 | } | 125 | } |
125 | 126 | ||