diff options
author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2008-08-23 09:46:38 +0000 |
---|---|---|
committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2008-08-23 09:46:38 +0000 |
commit | 1392dc2144a4b1810ba5c421f54e05dc1a3a74c7 (patch) | |
tree | 7f7f7d6dd6ce00e8146896456549441d4e8153d7 /firmware | |
parent | 965d2af61f5035dcf5179b8539785de641a9f015 (diff) | |
download | rockbox-1392dc2144a4b1810ba5c421f54e05dc1a3a74c7.tar.gz rockbox-1392dc2144a4b1810ba5c421f54e05dc1a3a74c7.zip |
Commit FS#9308: differentiate between TOUCHPAD & TOUCHSCREEN
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18338 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/button.c | 2 | ||||
-rw-r--r-- | firmware/export/button.h | 26 | ||||
-rw-r--r-- | firmware/export/config-cowond2.h | 2 | ||||
-rw-r--r-- | firmware/export/config-mrobe500.h | 2 | ||||
-rw-r--r-- | firmware/export/config-ondavx747.h | 2 | ||||
-rw-r--r-- | firmware/target/arm/tcc780x/cowond2/button-cowond2.c | 22 | ||||
-rw-r--r-- | firmware/target/arm/tcc780x/cowond2/button-target.h | 2 | ||||
-rw-r--r-- | firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c | 18 | ||||
-rw-r--r-- | firmware/target/arm/tms320dm320/mrobe-500/button-target.h | 8 | ||||
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/onda_vx747/button-target.h | 2 |
10 files changed, 43 insertions, 43 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 7be7fbc1b3..8ad93ae022 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c | |||
@@ -517,7 +517,7 @@ static int button_read(void) | |||
517 | 517 | ||
518 | /* Filter the button status. It is only accepted if we get the same | 518 | /* Filter the button status. It is only accepted if we get the same |
519 | status twice in a row. */ | 519 | status twice in a row. */ |
520 | #ifndef HAVE_TOUCHPAD | 520 | #ifndef HAVE_TOUCHSCREEN |
521 | if (btn != last_read) | 521 | if (btn != last_read) |
522 | retval = lastbtn; | 522 | retval = lastbtn; |
523 | else | 523 | else |
diff --git a/firmware/export/button.h b/firmware/export/button.h index f47639b3c7..0b4c8fd2b0 100644 --- a/firmware/export/button.h +++ b/firmware/export/button.h | |||
@@ -60,30 +60,30 @@ void wheel_send_events(bool send); | |||
60 | int button_apply_acceleration(const unsigned int data); | 60 | int button_apply_acceleration(const unsigned int data); |
61 | #endif | 61 | #endif |
62 | 62 | ||
63 | #define BUTTON_NONE 0x00000000 | 63 | #define BUTTON_NONE 0x00000000 |
64 | 64 | ||
65 | /* Button modifiers */ | 65 | /* Button modifiers */ |
66 | #define BUTTON_REL 0x02000000 | 66 | #define BUTTON_REL 0x02000000 |
67 | #define BUTTON_REPEAT 0x04000000 | 67 | #define BUTTON_REPEAT 0x04000000 |
68 | #define BUTTON_TOUCHPAD 0x08000000 | 68 | #define BUTTON_TOUCHSCREEN 0x08000000 |
69 | 69 | ||
70 | #ifdef HAVE_TOUCHPAD | 70 | #ifdef HAVE_TOUCHSCREEN |
71 | #if !defined(BUTTON_TOPLEFT) || !defined(BUTTON_TOPMIDDLE) \ | 71 | #if !defined(BUTTON_TOPLEFT) || !defined(BUTTON_TOPMIDDLE) \ |
72 | || !defined(BUTTON_TOPRIGHT) || !defined(BUTTON_MIDLEFT) \ | 72 | || !defined(BUTTON_TOPRIGHT) || !defined(BUTTON_MIDLEFT) \ |
73 | || !defined(BUTTON_CENTER) || !defined(BUTTON_MIDRIGHT) \ | 73 | || !defined(BUTTON_CENTER) || !defined(BUTTON_MIDRIGHT) \ |
74 | || !defined(BUTTON_BOTTOMLEFT) || !defined(BUTTON_BOTTOMMIDDLE) \ | 74 | || !defined(BUTTON_BOTTOMLEFT) || !defined(BUTTON_BOTTOMMIDDLE) \ |
75 | || !defined(BUTTON_BOTTOMRIGHT) | 75 | || !defined(BUTTON_BOTTOMRIGHT) |
76 | #error Touchpad button mode BUTTON_* defines not set up correctly | 76 | #error Touchscreen button mode BUTTON_* defines not set up correctly |
77 | #endif | 77 | #endif |
78 | enum touchpad_mode { | 78 | enum touchscreen_mode { |
79 | TOUCHPAD_POINT = 0, /* touchpad returns pixel co-ords */ | 79 | TOUCHSCREEN_POINT = 0, /* touchscreen returns pixel co-ords */ |
80 | TOUCHPAD_BUTTON, /* touchpad returns BUTTON_* area codes | 80 | TOUCHSCREEN_BUTTON, /* touchscreen returns BUTTON_* area codes |
81 | actual pixel value will still be accessable | 81 | actual pixel value will still be accessable |
82 | from button_get_data */ | 82 | from button_get_data */ |
83 | }; | 83 | }; |
84 | /* maybe define the number of buttons in button-target.h ? */ | 84 | /* maybe define the number of buttons in button-target.h ? */ |
85 | void touchpad_set_mode(enum touchpad_mode mode); | 85 | void touchscreen_set_mode(enum touchscreen_mode mode); |
86 | enum touchpad_mode touchpad_get_mode(void); | 86 | enum touchscreen_mode touchscreen_get_mode(void); |
87 | #endif | 87 | #endif |
88 | 88 | ||
89 | #endif /* _BUTTON_H_ */ | 89 | #endif /* _BUTTON_H_ */ |
diff --git a/firmware/export/config-cowond2.h b/firmware/export/config-cowond2.h index 828dc076b7..841390b479 100644 --- a/firmware/export/config-cowond2.h +++ b/firmware/export/config-cowond2.h | |||
@@ -60,7 +60,7 @@ | |||
60 | 60 | ||
61 | /* define this to indicate your device's keypad */ | 61 | /* define this to indicate your device's keypad */ |
62 | #define CONFIG_KEYPAD COWOND2_PAD | 62 | #define CONFIG_KEYPAD COWOND2_PAD |
63 | #define HAVE_TOUCHPAD | 63 | #define HAVE_TOUCHSCREEN |
64 | #define HAVE_BUTTON_DATA | 64 | #define HAVE_BUTTON_DATA |
65 | 65 | ||
66 | /* define this if you have a real-time clock */ | 66 | /* define this if you have a real-time clock */ |
diff --git a/firmware/export/config-mrobe500.h b/firmware/export/config-mrobe500.h index d7e172b50f..285a53a014 100644 --- a/firmware/export/config-mrobe500.h +++ b/firmware/export/config-mrobe500.h | |||
@@ -86,7 +86,7 @@ | |||
86 | #define DEFAULT_REMOTE_CONTRAST_SETTING 7 | 86 | #define DEFAULT_REMOTE_CONTRAST_SETTING 7 |
87 | 87 | ||
88 | #define CONFIG_KEYPAD MROBE500_PAD | 88 | #define CONFIG_KEYPAD MROBE500_PAD |
89 | #define HAVE_TOUCHPAD | 89 | #define HAVE_TOUCHSCREEN |
90 | #define HAVE_BUTTON_DATA | 90 | #define HAVE_BUTTON_DATA |
91 | 91 | ||
92 | /* Define this if you do software codec */ | 92 | /* Define this if you do software codec */ |
diff --git a/firmware/export/config-ondavx747.h b/firmware/export/config-ondavx747.h index 1c2be01d93..ffb5e90a75 100644 --- a/firmware/export/config-ondavx747.h +++ b/firmware/export/config-ondavx747.h | |||
@@ -66,7 +66,7 @@ | |||
66 | 66 | ||
67 | #define CONFIG_KEYPAD ONDAVX747_PAD | 67 | #define CONFIG_KEYPAD ONDAVX747_PAD |
68 | #define HAS_BUTTON_HOLD | 68 | #define HAS_BUTTON_HOLD |
69 | #define HAVE_TOUCHPAD | 69 | #define HAVE_TOUCHSCREEN |
70 | #define HAVE_BUTTON_DATA | 70 | #define HAVE_BUTTON_DATA |
71 | 71 | ||
72 | /* Define this if you do software codec */ | 72 | /* Define this if you do software codec */ |
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 | ||
31 | static enum touchpad_mode current_mode = TOUCHPAD_POINT; | 31 | static enum touchscreen_mode current_mode = TOUCHSCREEN_POINT; |
32 | 32 | ||
33 | static short last_x, last_y; | 33 | static short last_x, last_y; |
34 | static bool touch_available = false; | 34 | static bool touch_available = false; |
35 | 35 | ||
36 | static int touchpad_buttons[3][3] = | 36 | static 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 | ||
43 | void touchpad_set_mode(enum touchpad_mode mode) | 43 | void touchscreen_set_mode(enum touchscreen_mode mode) |
44 | { | 44 | { |
45 | current_mode = mode; | 45 | current_mode = mode; |
46 | } | 46 | } |
47 | 47 | ||
48 | enum touchpad_mode touchpad_get_mode(void) | 48 | enum 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) | |||
58 | struct touch_calibration_point { | 58 | struct 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 |
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c index 26136ce59b..ba2cedb76c 100644 --- a/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c +++ b/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c | |||
@@ -42,18 +42,18 @@ | |||
42 | static short last_x, last_y, last_z1, last_z2; /* for the touch screen */ | 42 | static short last_x, last_y, last_z1, last_z2; /* for the touch screen */ |
43 | static bool touch_available = false; | 43 | static bool touch_available = false; |
44 | 44 | ||
45 | static enum touchpad_mode current_mode = TOUCHPAD_POINT; | 45 | static enum touchscreen_mode current_mode = TOUCHSCREEN_POINT; |
46 | static int touchpad_buttons[3][3] = { | 46 | static int touchscreen_buttons[3][3] = { |
47 | {BUTTON_TOPLEFT, BUTTON_TOPMIDDLE, BUTTON_TOPRIGHT}, | 47 | {BUTTON_TOPLEFT, BUTTON_TOPMIDDLE, BUTTON_TOPRIGHT}, |
48 | {BUTTON_MIDLEFT, BUTTON_CENTER, BUTTON_MIDRIGHT}, | 48 | {BUTTON_MIDLEFT, BUTTON_CENTER, BUTTON_MIDRIGHT}, |
49 | {BUTTON_BOTTOMLEFT, BUTTON_BOTTOMMIDDLE, BUTTON_BOTTOMRIGHT}, | 49 | {BUTTON_BOTTOMLEFT, BUTTON_BOTTOMMIDDLE, BUTTON_BOTTOMRIGHT}, |
50 | }; | 50 | }; |
51 | 51 | ||
52 | void touchpad_set_mode(enum touchpad_mode mode) | 52 | void touchscreen_set_mode(enum touchscreen_mode mode) |
53 | { | 53 | { |
54 | current_mode = mode; | 54 | current_mode = mode; |
55 | } | 55 | } |
56 | enum touchpad_mode touchpad_get_mode(void) | 56 | enum touchscreen_mode touchscreen_get_mode(void) |
57 | { | 57 | { |
58 | return current_mode; | 58 | return current_mode; |
59 | } | 59 | } |
@@ -185,13 +185,13 @@ int button_read_device(int *data) | |||
185 | *data = touch_to_pixels(x, y); | 185 | *data = touch_to_pixels(x, y); |
186 | switch (current_mode) | 186 | switch (current_mode) |
187 | { | 187 | { |
188 | case TOUCHPAD_POINT: | 188 | case TOUCHSCREEN_POINT: |
189 | r_button |= BUTTON_TOUCHPAD; | 189 | r_button |= BUTTON_TOUCHSCREEN; |
190 | break; | 190 | break; |
191 | case TOUCHPAD_BUTTON: | 191 | case TOUCHSCREEN_BUTTON: |
192 | { | 192 | { |
193 | int px_x = ((*data&0xffff0000)>>16), px_y = ((*data&0x0000ffff)); | 193 | int px_x = ((*data&0xffff0000)>>16), px_y = ((*data&0x0000ffff)); |
194 | r_button |= touchpad_buttons[px_y/(LCD_HEIGHT/3)][px_x/(LCD_WIDTH/3)]; | 194 | r_button |= touchscreen_buttons[px_y/(LCD_HEIGHT/3)][px_x/(LCD_WIDTH/3)]; |
195 | oldbutton = r_button; | 195 | oldbutton = r_button; |
196 | break; | 196 | break; |
197 | } | 197 | } |
@@ -233,7 +233,7 @@ int button_read_device(int *data) | |||
233 | return r_button; | 233 | return r_button; |
234 | } | 234 | } |
235 | 235 | ||
236 | /* Touchpad data available interupt */ | 236 | /* Touchscreen data available interupt */ |
237 | void read_battery_inputs(void); | 237 | void read_battery_inputs(void); |
238 | void GIO14(void) | 238 | void GIO14(void) |
239 | { | 239 | { |
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/button-target.h b/firmware/target/arm/tms320dm320/mrobe-500/button-target.h index 30cc55dada..5b888b3e0a 100644 --- a/firmware/target/arm/tms320dm320/mrobe-500/button-target.h +++ b/firmware/target/arm/tms320dm320/mrobe-500/button-target.h | |||
@@ -33,7 +33,7 @@ int button_read_device(int *data); | |||
33 | struct touch_calibration_point { | 33 | struct touch_calibration_point { |
34 | short px_x; /* known pixel value */ | 34 | short px_x; /* known pixel value */ |
35 | short px_y; | 35 | short px_y; |
36 | short val_x; /* touchpad value at the known pixel */ | 36 | short val_x; /* touchscreen value at the known pixel */ |
37 | short val_y; | 37 | short val_y; |
38 | }; | 38 | }; |
39 | void use_calibration(bool enable); | 39 | void use_calibration(bool enable); |
@@ -55,7 +55,7 @@ void use_calibration(bool enable); | |||
55 | 55 | ||
56 | #define BUTTON_TOUCH 0x00000200 | 56 | #define BUTTON_TOUCH 0x00000200 |
57 | 57 | ||
58 | /* Touchpad Screen Area Buttons */ | 58 | /* Touch Screen Area Buttons */ |
59 | #define BUTTON_TOPLEFT 0x00004000 | 59 | #define BUTTON_TOPLEFT 0x00004000 |
60 | #define BUTTON_TOPMIDDLE 0x00008000 | 60 | #define BUTTON_TOPMIDDLE 0x00008000 |
61 | #define BUTTON_TOPRIGHT 0x00010000 | 61 | #define BUTTON_TOPRIGHT 0x00010000 |
@@ -67,8 +67,8 @@ void use_calibration(bool enable); | |||
67 | #define BUTTON_BOTTOMRIGHT 0x00400000 | 67 | #define BUTTON_BOTTOMRIGHT 0x00400000 |
68 | 68 | ||
69 | /* compatibility hacks | 69 | /* compatibility hacks |
70 | not mapped to the touchpad button areas because | 70 | not mapped to the touchscreen button areas because |
71 | the touchpad is not always in that mode */ | 71 | the touchscreen is not always in that mode */ |
72 | #define BUTTON_LEFT BUTTON_RC_REW | 72 | #define BUTTON_LEFT BUTTON_RC_REW |
73 | #define BUTTON_RIGHT BUTTON_RC_FF | 73 | #define BUTTON_RIGHT BUTTON_RC_FF |
74 | 74 | ||
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/button-target.h b/firmware/target/mips/ingenic_jz47xx/onda_vx747/button-target.h index 23ce386cb1..677e4d1c67 100644 --- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/button-target.h +++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/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 |