From 244afc0a0faa24719aba1cf5d2cfa4fbf6f61258 Mon Sep 17 00:00:00 2001 From: Marc Guay Date: Mon, 25 May 2009 20:04:31 +0000 Subject: Improve the c100 keymap and button names. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21081 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/tcc77x/c100/button-c100.c | 23 ++++++++++++----------- firmware/target/arm/tcc77x/c100/button-target.h | 12 ++++++------ 2 files changed, 18 insertions(+), 17 deletions(-) (limited to 'firmware/target/arm') diff --git a/firmware/target/arm/tcc77x/c100/button-c100.c b/firmware/target/arm/tcc77x/c100/button-c100.c index c3d04f7016..ebf92f780c 100644 --- a/firmware/target/arm/tcc77x/c100/button-c100.c +++ b/firmware/target/arm/tcc77x/c100/button-c100.c @@ -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) diff --git a/firmware/target/arm/tcc77x/c100/button-target.h b/firmware/target/arm/tcc77x/c100/button-target.h index acf80b2ed7..73c04b6ed6 100644 --- a/firmware/target/arm/tcc77x/c100/button-target.h +++ b/firmware/target/arm/tcc77x/c100/button-target.h @@ -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_ */ -- cgit v1.2.3