mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
Improve the c100 keymap and button names.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21081 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
cd5e98db08
commit
244afc0a0f
3 changed files with 88 additions and 128 deletions
|
|
@ -31,30 +31,31 @@ void button_init_device(void)
|
|||
int button_read_device(void)
|
||||
{
|
||||
int btn = BUTTON_NONE;
|
||||
|
||||
if (!button_hold()){
|
||||
|
||||
if (!button_hold())
|
||||
{
|
||||
GPIOA |= 0x4;
|
||||
GPIOA &= ~0x8;
|
||||
|
||||
|
||||
int i=20; while (i--);
|
||||
|
||||
if (GPIOA & 0x10) btn |= BUTTON_PLAYPAUSE; /* up */
|
||||
|
||||
if (GPIOA & 0x10) btn |= BUTTON_UP;
|
||||
if (GPIOA & 0x20) btn |= BUTTON_RIGHT;
|
||||
if (GPIOA & 0x40) btn |= BUTTON_LEFT;
|
||||
|
||||
GPIOA |= 0x8;
|
||||
GPIOA &= ~0x4;
|
||||
|
||||
|
||||
i=20; while (i--);
|
||||
|
||||
|
||||
if (GPIOA & 0x10) btn |= BUTTON_VOLUP;
|
||||
if (GPIOA & 0x20) btn |= BUTTON_VOLDOWN;
|
||||
if (GPIOA & 0x40) btn |= BUTTON_REPEATAB; /* down */
|
||||
|
||||
if (GPIOA & 0x40) btn |= BUTTON_DOWN;
|
||||
|
||||
if (GPIOA & 0x80) btn |= BUTTON_SELECT;
|
||||
if (GPIOA & 0x100) btn |= BUTTON_MENU;
|
||||
if (GPIOA & 0x100) btn |= BUTTON_POWER;
|
||||
}
|
||||
return btn;
|
||||
return btn;
|
||||
}
|
||||
|
||||
bool button_hold(void)
|
||||
|
|
|
|||
|
|
@ -32,23 +32,23 @@ int button_read_device(void);
|
|||
bool button_hold(void);
|
||||
|
||||
/* Main unit's buttons */
|
||||
#define BUTTON_MENU 0x00000001
|
||||
#define BUTTON_POWER 0x00000001
|
||||
#define BUTTON_VOLUP 0x00000002
|
||||
#define BUTTON_VOLDOWN 0x00000004
|
||||
#define BUTTON_PLAYPAUSE 0x00000008
|
||||
#define BUTTON_REPEATAB 0x00000010
|
||||
#define BUTTON_UP 0x00000008
|
||||
#define BUTTON_DOWN 0x00000010
|
||||
#define BUTTON_LEFT 0x00000020
|
||||
#define BUTTON_RIGHT 0x00000040
|
||||
#define BUTTON_SELECT 0x00000080
|
||||
|
||||
#define BUTTON_MAIN (BUTTON_MENU|BUTTON_VOLUP|BUTTON_VOLDOWN\
|
||||
|BUTTON_PLAYPAUSE|BUTTON_REPEATAB|BUTTON_LEFT\
|
||||
#define BUTTON_MAIN (BUTTON_POWER|BUTTON_VOLUP|BUTTON_VOLDOWN\
|
||||
|BUTTON_UP|BUTTON_DOWN|BUTTON_LEFT\
|
||||
|BUTTON_RIGHT|BUTTON_SELECT)
|
||||
|
||||
#define BUTTON_REMOTE 0
|
||||
|
||||
/* Software power-off */
|
||||
#define POWEROFF_BUTTON BUTTON_MENU
|
||||
#define POWEROFF_BUTTON BUTTON_POWER
|
||||
#define POWEROFF_COUNT 40
|
||||
|
||||
#endif /* _BUTTON_TARGET_H_ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue