summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-05-17 17:16:12 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-05-17 17:16:12 +0000
commitbe28f8441b84765caf334d1f5f0b3fe50b3b6b35 (patch)
tree5005eb26ab557507d33acbcf86c9365c730e39eb
parentd587247ebdde98058bcd90911e1d10147bd1fab5 (diff)
downloadrockbox-be28f8441b84765caf334d1f5f0b3fe50b3b6b35.zip
rockbox-be28f8441b84765caf334d1f5f0b3fe50b3b6b35.tar.gz
rockbox-be28f8441b84765caf334d1f5f0b3fe50b3b6b35.tar.bz2
rockbox-be28f8441b84765caf334d1f5f0b3fe50b3b6b35.tar.xz
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.c17
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 8460e29..9f6d54d 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)
buttonlight_on();
}
- /* the touchpad */
- touchpad = GPJDAT & 0x10C9;
+ /* the touchpad - only watch the lines we actually read */
+ touchpad = GPJDAT & (((1 << 12) | (1 << 11)) | /* right++, right+ */
+ ((1 << 8) | (1 << 7)) | /* left+, left++ */
+ ((1 << 6) | (1 << 5)) | /* down++, down+ */
+ ((1 << 1) | (1 << 0)) | /* up+, up++ */
+ (1 << 3)); /* center */
if (touchpad)
{
+ if (touchpad & (1 << 3))
+ {
+ btn |= BUTTON_SELECT;
+ /* Desensitize middle (+) detectors one level */
+ touchpad &= ~((1 << 11) | (1 << 8) | (1 << 5) | (1 << 1));
+ }
+
if (touchpad & ((1 << 1) | (1 << 0)))
btn |= BUTTON_UP;
@@ -138,8 +149,6 @@ int button_read_device(void)
if (touchpad & ((1 << 8) | (1 << 7)))
btn |= BUTTON_LEFT;
- if (touchpad & (1 << 3))
- btn |= BUTTON_SELECT;
buttonlight_on();
}