diff options
Diffstat (limited to 'firmware')
-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 | ||