summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-05-17 19:23:04 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-05-17 19:23:04 +0000
commit833556c2e7683aec583d5558fee400b1c6554623 (patch)
tree8fc0869b06711ce7d4e3ea28e70435e381a14c5c /firmware
parentaf1e5e6926ac5378f7e7f19a12441b0a63238f09 (diff)
Doh! Button signals are active low
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@624 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/button.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c
index 9e00efc0ec..3e35e0eea4 100644
--- a/firmware/drivers/button.c
+++ b/firmware/drivers/button.c
@@ -170,17 +170,18 @@ int button_get(void)
int portc = PCDR;
int btn = 0;
- if ( portc & 1 )
+ /* buttons are active low */
+ if ( !(portc & 1) )
btn |= BUTTON_LEFT;
- if ( portc & 2 )
+ if ( !(portc & 2) )
btn |= BUTTON_MENU;
- if ( portc & 4 )
+ if ( !(portc & 4) )
btn |= BUTTON_RIGHT;
- if ( portc & 8 )
+ if ( !(portc & 8) )
btn |= BUTTON_PLAY | BUTTON_UP;
- if ( porta & 0x20 )
+ if ( !(porta & 0x20) )
btn |= BUTTON_ON;
- if ( porta & 0x800 )
+ if ( !(porta & 0x800) )
btn |= BUTTON_STOP | BUTTON_DOWN;
return btn;