From 9ba4864d73b647646d3c5c0525b656b2c758f7d8 Mon Sep 17 00:00:00 2001 From: Karl Kurbjun Date: Thu, 29 May 2008 22:22:44 +0000 Subject: 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 --- firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c | 15 +-------------- firmware/target/arm/s3c2440/gigabeat-fx/button-target.h | 17 ++++++++--------- 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 c43d188..790d8aa 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 a5876aa..6d2d6c0 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 */ -- cgit v1.1