From be28f8441b84765caf334d1f5f0b3fe50b3b6b35 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sat, 17 May 2008 17:16:12 +0000 Subject: Refine meg-fx pad changes. Actually watch the other + 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 --- firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'firmware') 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) 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(); } -- cgit v1.2.3