diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2008-05-17 17:16:12 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2008-05-17 17:16:12 +0000 |
commit | be28f8441b84765caf334d1f5f0b3fe50b3b6b35 (patch) | |
tree | 5005eb26ab557507d33acbcf86c9365c730e39eb | |
parent | d587247ebdde98058bcd90911e1d10147bd1fab5 (diff) | |
download | rockbox-be28f8441b84765caf334d1f5f0b3fe50b3b6b35.tar.gz rockbox-be28f8441b84765caf334d1f5f0b3fe50b3b6b35.zip |
Refine meg-fx pad changes. Actually watch the other <dir>+ lines and ignore them if center is detected but sill allow the combo if one really means to do that.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17559 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c index 8460e2970d..9f6d54df9d 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c +++ b/firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c | |||
@@ -122,10 +122,21 @@ int button_read_device(void) | |||
122 | buttonlight_on(); | 122 | buttonlight_on(); |
123 | } | 123 | } |
124 | 124 | ||
125 | /* the touchpad */ | 125 | /* the touchpad - only watch the lines we actually read */ |
126 | touchpad = GPJDAT & 0x10C9; | 126 | touchpad = GPJDAT & (((1 << 12) | (1 << 11)) | /* right++, right+ */ |
127 | ((1 << 8) | (1 << 7)) | /* left+, left++ */ | ||
128 | ((1 << 6) | (1 << 5)) | /* down++, down+ */ | ||
129 | ((1 << 1) | (1 << 0)) | /* up+, up++ */ | ||
130 | (1 << 3)); /* center */ | ||
127 | if (touchpad) | 131 | if (touchpad) |
128 | { | 132 | { |
133 | if (touchpad & (1 << 3)) | ||
134 | { | ||
135 | btn |= BUTTON_SELECT; | ||
136 | /* Desensitize middle (+) detectors one level */ | ||
137 | touchpad &= ~((1 << 11) | (1 << 8) | (1 << 5) | (1 << 1)); | ||
138 | } | ||
139 | |||
129 | if (touchpad & ((1 << 1) | (1 << 0))) | 140 | if (touchpad & ((1 << 1) | (1 << 0))) |
130 | btn |= BUTTON_UP; | 141 | btn |= BUTTON_UP; |
131 | 142 | ||
@@ -138,8 +149,6 @@ int button_read_device(void) | |||
138 | if (touchpad & ((1 << 8) | (1 << 7))) | 149 | if (touchpad & ((1 << 8) | (1 << 7))) |
139 | btn |= BUTTON_LEFT; | 150 | btn |= BUTTON_LEFT; |
140 | 151 | ||
141 | if (touchpad & (1 << 3)) | ||
142 | btn |= BUTTON_SELECT; | ||
143 | buttonlight_on(); | 152 | buttonlight_on(); |
144 | } | 153 | } |
145 | 154 | ||