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
This commit is contained in:
Karl Kurbjun 2008-05-29 22:22:44 +00:00
parent 3b730a280d
commit 9ba4864d73
2 changed files with 9 additions and 23 deletions

View file

@ -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();
}

View file

@ -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 */