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 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'firmware/target/arm/tcc77x/c100/button-c100.c') 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) -- cgit v1.2.3