summaryrefslogtreecommitdiff
path: root/firmware/target/arm/tcc780x
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/tcc780x')
-rw-r--r--firmware/target/arm/tcc780x/cowond2/button-cowond2.c22
-rw-r--r--firmware/target/arm/tcc780x/cowond2/button-target.h2
2 files changed, 12 insertions, 12 deletions
diff --git a/firmware/target/arm/tcc780x/cowond2/button-cowond2.c b/firmware/target/arm/tcc780x/cowond2/button-cowond2.c
index 0da55e3f0a..9449bcdf30 100644
--- a/firmware/target/arm/tcc780x/cowond2/button-cowond2.c
+++ b/firmware/target/arm/tcc780x/cowond2/button-cowond2.c
@@ -28,24 +28,24 @@
28 28
29#define TOUCH_MARGIN 8 29#define TOUCH_MARGIN 8
30 30
31static enum touchpad_mode current_mode = TOUCHPAD_POINT; 31static enum touchscreen_mode current_mode = TOUCHSCREEN_POINT;
32 32
33static short last_x, last_y; 33static short last_x, last_y;
34static bool touch_available = false; 34static bool touch_available = false;
35 35
36static int touchpad_buttons[3][3] = 36static int touchscreen_buttons[3][3] =
37{ 37{
38 {BUTTON_TOPLEFT, BUTTON_TOPMIDDLE, BUTTON_TOPRIGHT}, 38 {BUTTON_TOPLEFT, BUTTON_TOPMIDDLE, BUTTON_TOPRIGHT},
39 {BUTTON_MIDLEFT, BUTTON_CENTER, BUTTON_MIDRIGHT}, 39 {BUTTON_MIDLEFT, BUTTON_CENTER, BUTTON_MIDRIGHT},
40 {BUTTON_BOTTOMLEFT, BUTTON_BOTTOMMIDDLE, BUTTON_BOTTOMRIGHT}, 40 {BUTTON_BOTTOMLEFT, BUTTON_BOTTOMMIDDLE, BUTTON_BOTTOMRIGHT},
41}; 41};
42 42
43void touchpad_set_mode(enum touchpad_mode mode) 43void touchscreen_set_mode(enum touchscreen_mode mode)
44{ 44{
45 current_mode = mode; 45 current_mode = mode;
46} 46}
47 47
48enum touchpad_mode touchpad_get_mode(void) 48enum touchscreen_mode touchscreen_get_mode(void)
49{ 49{
50 return current_mode; 50 return current_mode;
51} 51}
@@ -58,7 +58,7 @@ void button_set_touch_available(void)
58struct touch_calibration_point { 58struct touch_calibration_point {
59 short px_x; /* known pixel value */ 59 short px_x; /* known pixel value */
60 short px_y; 60 short px_y;
61 short val_x; /* touchpad value at the known pixel */ 61 short val_x; /* touchscreen value at the known pixel */
62 short val_y; 62 short val_y;
63}; 63};
64 64
@@ -188,15 +188,15 @@ int button_read_device(int *data)
188 *data = touch_to_pixels(x, y); 188 *data = touch_to_pixels(x, y);
189 switch (current_mode) 189 switch (current_mode)
190 { 190 {
191 case TOUCHPAD_POINT: 191 case TOUCHSCREEN_POINT:
192 btn |= BUTTON_TOUCHPAD; 192 btn |= BUTTON_TOUCHSCREEN;
193 break; 193 break;
194 case TOUCHPAD_BUTTON: 194 case TOUCHSCREEN_BUTTON:
195 { 195 {
196 int px_x = (*data&0xffff0000)>>16; 196 int px_x = (*data&0xffff0000)>>16;
197 int px_y = (*data&0x0000ffff); 197 int px_y = (*data&0x0000ffff);
198 btn |= touchpad_buttons[px_y/(LCD_HEIGHT/3)] 198 btn |= touchscreen_buttons[px_y/(LCD_HEIGHT/3)]
199 [px_x/(LCD_WIDTH/3)]; 199 [px_x/(LCD_WIDTH/3)];
200 break; 200 break;
201 } 201 }
202 } 202 }
@@ -208,7 +208,7 @@ int button_read_device(int *data)
208 if (!(GPIOA & 0x4)) 208 if (!(GPIOA & 0x4))
209 btn |= BUTTON_POWER; 209 btn |= BUTTON_POWER;
210 210
211 if(btn & BUTTON_TOUCHPAD && !is_backlight_on(true)) 211 if(btn & BUTTON_TOUCHSCREEN && !is_backlight_on(true))
212 *data = 0; 212 *data = 0;
213 213
214 return btn; 214 return btn;
diff --git a/firmware/target/arm/tcc780x/cowond2/button-target.h b/firmware/target/arm/tcc780x/cowond2/button-target.h
index d315d0172f..faf660fc71 100644
--- a/firmware/target/arm/tcc780x/cowond2/button-target.h
+++ b/firmware/target/arm/tcc780x/cowond2/button-target.h
@@ -44,7 +44,7 @@ void button_set_touch_available(void);
44#define BUTTON_UP BUTTON_TOPMIDDLE 44#define BUTTON_UP BUTTON_TOPMIDDLE
45#define BUTTON_DOWN BUTTON_BOTTOMMIDDLE 45#define BUTTON_DOWN BUTTON_BOTTOMMIDDLE
46 46
47/* Touchpad Screen Area Buttons */ 47/* Touch Screen Area Buttons */
48#define BUTTON_TOPLEFT 0x00000010 48#define BUTTON_TOPLEFT 0x00000010
49#define BUTTON_TOPMIDDLE 0x00000020 49#define BUTTON_TOPMIDDLE 0x00000020
50#define BUTTON_TOPRIGHT 0x00000040 50#define BUTTON_TOPRIGHT 0x00000040