Philips SA9200: fix the buttons to work with flip screen mode (does anyone use this?). Change to conventional BUTTON_LEFT/BUTTON_RIGHT names and flip the remaining directional buttons.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21698 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Mark Arigo 2009-07-07 03:26:57 +00:00
parent a9edc8440d
commit fb224bd0f9
4 changed files with 83 additions and 69 deletions

View file

@ -444,6 +444,10 @@ static int button_flip(int button)
#endif
#if CONFIG_KEYPAD == SANSA_C200_PAD
| BUTTON_VOL_UP | BUTTON_VOL_DOWN
#endif
#if CONFIG_KEYPAD == PHILIPS_SA9200_PAD
| BUTTON_VOL_UP | BUTTON_VOL_DOWN
| BUTTON_NEXT | BUTTON_PREV
#endif
);
@ -475,6 +479,16 @@ static int button_flip(int button)
if (button & BUTTON_VOL_DOWN)
newbutton |= BUTTON_VOL_UP;
#endif
#if CONFIG_KEYPAD == PHILIPS_SA9200_PAD
if (button & BUTTON_VOL_UP)
newbutton |= BUTTON_VOL_DOWN;
if (button & BUTTON_VOL_DOWN)
newbutton |= BUTTON_VOL_UP;
if (button & BUTTON_NEXT)
newbutton |= BUTTON_PREV;
if (button & BUTTON_PREV)
newbutton |= BUTTON_NEXT;
#endif
return newbutton;
}

View file

@ -51,10 +51,10 @@ void button_int(void)
if (val == MEP_BUTTON_HEADER)
{
/* Buttons packet */
if (data[1] & 0x1) int_btn |= BUTTON_FFWD;
if (data[1] & 0x2) int_btn |= BUTTON_RIGHT;
if (data[1] & 0x4) int_btn |= BUTTON_LEFT;
if (data[1] & 0x8) int_btn |= BUTTON_REW;
if (data[1] & 0x1) int_btn |= BUTTON_RIGHT;
if (data[1] & 0x2) int_btn |= BUTTON_NEXT;
if (data[1] & 0x4) int_btn |= BUTTON_PREV;
if (data[1] & 0x8) int_btn |= BUTTON_LEFT;
if (data[2] & 0x1) int_btn |= BUTTON_MENU;
}
else if (val == MEP_ABSOLUTE_HEADER)

View file

@ -43,10 +43,10 @@ void button_int(void);
#define BUTTON_POWER 0x00000001
#define BUTTON_PLAY 0x00000002
#define BUTTON_MENU 0x00000004
#define BUTTON_LEFT 0x00000008
#define BUTTON_RIGHT 0x00000010
#define BUTTON_REW 0x00000020
#define BUTTON_FFWD 0x00000040
#define BUTTON_PREV 0x00000008
#define BUTTON_NEXT 0x00000010
#define BUTTON_LEFT 0x00000020
#define BUTTON_RIGHT 0x00000040
#define BUTTON_UP 0x00000080
#define BUTTON_DOWN 0x00000100
#define BUTTON_VOL_UP 0x00000200