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/target/arm/tcc780x | |
parent | 965d2af61f5035dcf5179b8539785de641a9f015 (diff) |
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/target/arm/tcc780x')
-rw-r--r-- | firmware/target/arm/tcc780x/cowond2/button-cowond2.c | 22 | ||||
-rw-r--r-- | firmware/target/arm/tcc780x/cowond2/button-target.h | 2 |
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 @@ #define TOUCH_MARGIN 8 -static enum touchpad_mode current_mode = TOUCHPAD_POINT; +static enum touchscreen_mode current_mode = TOUCHSCREEN_POINT; static short last_x, last_y; static bool touch_available = false; -static int touchpad_buttons[3][3] = +static int touchscreen_buttons[3][3] = { {BUTTON_TOPLEFT, BUTTON_TOPMIDDLE, BUTTON_TOPRIGHT}, {BUTTON_MIDLEFT, BUTTON_CENTER, BUTTON_MIDRIGHT}, {BUTTON_BOTTOMLEFT, BUTTON_BOTTOMMIDDLE, BUTTON_BOTTOMRIGHT}, }; -void touchpad_set_mode(enum touchpad_mode mode) +void touchscreen_set_mode(enum touchscreen_mode mode) { current_mode = mode; } -enum touchpad_mode touchpad_get_mode(void) +enum touchscreen_mode touchscreen_get_mode(void) { return current_mode; } @@ -58,7 +58,7 @@ void button_set_touch_available(void) struct touch_calibration_point { short px_x; /* known pixel value */ short px_y; - short val_x; /* touchpad value at the known pixel */ + short val_x; /* touchscreen value at the known pixel */ short val_y; }; @@ -188,15 +188,15 @@ int button_read_device(int *data) *data = touch_to_pixels(x, y); switch (current_mode) { - case TOUCHPAD_POINT: - btn |= BUTTON_TOUCHPAD; + case TOUCHSCREEN_POINT: + btn |= BUTTON_TOUCHSCREEN; break; - case TOUCHPAD_BUTTON: + case TOUCHSCREEN_BUTTON: { int px_x = (*data&0xffff0000)>>16; int px_y = (*data&0x0000ffff); - btn |= touchpad_buttons[px_y/(LCD_HEIGHT/3)] - [px_x/(LCD_WIDTH/3)]; + btn |= touchscreen_buttons[px_y/(LCD_HEIGHT/3)] + [px_x/(LCD_WIDTH/3)]; break; } } @@ -208,7 +208,7 @@ int button_read_device(int *data) if (!(GPIOA & 0x4)) btn |= BUTTON_POWER; - if(btn & BUTTON_TOUCHPAD && !is_backlight_on(true)) + if(btn & BUTTON_TOUCHSCREEN && !is_backlight_on(true)) *data = 0; 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); #define BUTTON_UP BUTTON_TOPMIDDLE #define BUTTON_DOWN BUTTON_BOTTOMMIDDLE -/* Touchpad Screen Area Buttons */ +/* Touch Screen Area Buttons */ #define BUTTON_TOPLEFT 0x00000010 #define BUTTON_TOPMIDDLE 0x00000020 #define BUTTON_TOPRIGHT 0x00000040 |