summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2008-05-29 22:22:44 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2008-05-29 22:22:44 +0000
commit9ba4864d73b647646d3c5c0525b656b2c758f7d8 (patch)
treee73021198fd52a8e26b967902fb279452fd79072
parent3b730a280d0fab13b65d03514a122fc7f8d86686 (diff)
Simplify the button handling code on the Gigabeat F/X a bit for the side buttons. Plugins should be updated with this revision, or the buttons in plugins will not operate properly.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17659 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c15
-rw-r--r--firmware/target/arm/s3c2440/gigabeat-fx/button-target.h17
2 files changed, 9 insertions, 23 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 c43d1884f4..790d8aa634 100644
--- a/firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c
+++ b/firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c
@@ -119,20 +119,7 @@ int button_read_device(void)
buttons = GPGDAT & 0x1F;
if (buttons)
{
- if (buttons & (1 << 0))
- btn |= BUTTON_POWER;
-
- if (buttons & (1 << 1))
- btn |= BUTTON_MENU;
-
- if (buttons & (1 << 2))
- btn |= BUTTON_VOL_UP;
-
- if (buttons & (1 << 3))
- btn |= BUTTON_VOL_DOWN;
-
- if (buttons & (1 << 4))
- btn |= BUTTON_A;
+ btn |= buttons;
buttonlight_on();
}
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/button-target.h b/firmware/target/arm/s3c2440/gigabeat-fx/button-target.h
index a5876aadde..6d2d6c084b 100644
--- a/firmware/target/arm/s3c2440/gigabeat-fx/button-target.h
+++ b/firmware/target/arm/s3c2440/gigabeat-fx/button-target.h
@@ -33,17 +33,16 @@ void touchpad_set_sensitivity(int level);
#define BUTTON_POWER 0x00000001
#define BUTTON_MENU 0x00000002
+#define BUTTON_VOL_UP 0x00000004
+#define BUTTON_VOL_DOWN 0x00000008
+#define BUTTON_A 0x00000010
-#define BUTTON_LEFT 0x00000004
-#define BUTTON_RIGHT 0x00000008
-#define BUTTON_UP 0x00000010
-#define BUTTON_DOWN 0x00000020
+#define BUTTON_LEFT 0x00000020
+#define BUTTON_RIGHT 0x00000040
+#define BUTTON_UP 0x00000080
+#define BUTTON_DOWN 0x00000100
-#define BUTTON_VOL_UP 0x00000040
-#define BUTTON_VOL_DOWN 0x00000080
-
-#define BUTTON_SELECT 0x00000100
-#define BUTTON_A 0x00000200
+#define BUTTON_SELECT 0x00000200
/* Remote control buttons */