summaryrefslogtreecommitdiff
path: root/firmware/target/arm/tcc77x/c100/button-c100.c
diff options
context:
space:
mode:
authorMarc Guay <marcguay@rockbox.org>2009-05-25 20:04:31 +0000
committerMarc Guay <marcguay@rockbox.org>2009-05-25 20:04:31 +0000
commit244afc0a0faa24719aba1cf5d2cfa4fbf6f61258 (patch)
tree6b40bcd3f22085cb2d1064068d39c9083cdae7da /firmware/target/arm/tcc77x/c100/button-c100.c
parentcd5e98db08ee25cbabcafbd005b7eb9820a15137 (diff)
downloadrockbox-244afc0a0faa24719aba1cf5d2cfa4fbf6f61258.tar.gz
rockbox-244afc0a0faa24719aba1cf5d2cfa4fbf6f61258.zip
Improve the c100 keymap and button names.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21081 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/tcc77x/c100/button-c100.c')
-rw-r--r--firmware/target/arm/tcc77x/c100/button-c100.c23
1 files changed, 12 insertions, 11 deletions
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)
31int button_read_device(void) 31int button_read_device(void)
32{ 32{
33 int btn = BUTTON_NONE; 33 int btn = BUTTON_NONE;
34 34
35 if (!button_hold()){ 35 if (!button_hold())
36 {
36 GPIOA |= 0x4; 37 GPIOA |= 0x4;
37 GPIOA &= ~0x8; 38 GPIOA &= ~0x8;
38 39
39 int i=20; while (i--); 40 int i=20; while (i--);
40 41
41 if (GPIOA & 0x10) btn |= BUTTON_PLAYPAUSE; /* up */ 42 if (GPIOA & 0x10) btn |= BUTTON_UP;
42 if (GPIOA & 0x20) btn |= BUTTON_RIGHT; 43 if (GPIOA & 0x20) btn |= BUTTON_RIGHT;
43 if (GPIOA & 0x40) btn |= BUTTON_LEFT; 44 if (GPIOA & 0x40) btn |= BUTTON_LEFT;
44 45
45 GPIOA |= 0x8; 46 GPIOA |= 0x8;
46 GPIOA &= ~0x4; 47 GPIOA &= ~0x4;
47 48
48 i=20; while (i--); 49 i=20; while (i--);
49 50
50 if (GPIOA & 0x10) btn |= BUTTON_VOLUP; 51 if (GPIOA & 0x10) btn |= BUTTON_VOLUP;
51 if (GPIOA & 0x20) btn |= BUTTON_VOLDOWN; 52 if (GPIOA & 0x20) btn |= BUTTON_VOLDOWN;
52 if (GPIOA & 0x40) btn |= BUTTON_REPEATAB; /* down */ 53 if (GPIOA & 0x40) btn |= BUTTON_DOWN;
53 54
54 if (GPIOA & 0x80) btn |= BUTTON_SELECT; 55 if (GPIOA & 0x80) btn |= BUTTON_SELECT;
55 if (GPIOA & 0x100) btn |= BUTTON_MENU; 56 if (GPIOA & 0x100) btn |= BUTTON_POWER;
56 } 57 }
57 return btn; 58 return btn;
58} 59}
59 60
60bool button_hold(void) 61bool button_hold(void)