summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Wardell <rockbox@barrywardell.net>2006-09-13 23:38:16 +0000
committerBarry Wardell <rockbox@barrywardell.net>2006-09-13 23:38:16 +0000
commit0b1ae73d3af28815169765be9cd50c9c0020594f (patch)
tree74e6e25920aa946d74b7c7cffe2ccbf17d959490
parent75a1247f81afd5bce509ffda9b4a5b361d554685 (diff)
downloadrockbox-0b1ae73d3af28815169765be9cd50c9c0020594f.tar.gz
rockbox-0b1ae73d3af28815169765be9cd50c9c0020594f.zip
Fix behaviour of "Backlight (On Hold Key)" for H10. Make sure button GPIO ports are enabled on H10.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10943 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/iriver/h10/button-h10.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/firmware/target/arm/iriver/h10/button-h10.c b/firmware/target/arm/iriver/h10/button-h10.c
index 55f073839e..6980948336 100644
--- a/firmware/target/arm/iriver/h10/button-h10.c
+++ b/firmware/target/arm/iriver/h10/button-h10.c
@@ -33,7 +33,14 @@
void button_init_device(void)
{
+ /* Enable REW, FF, Play, Left, Right, Hold buttons */
+ GPIOA_ENABLE |= 0xfc;
+
+ /* Enable POWER button */
+ GPIOB_ENABLE |= 0x1;
+
/* We need to output to pin 6 of GPIOD when reading the scroll pad value */
+ GPIOD_ENABLE |= 0x40;
GPIOD_OUTPUT_EN |= 0x40;
GPIOD_OUTPUT_VAL |= 0x40;
}
@@ -51,16 +58,20 @@ int button_read_device(void)
int btn = BUTTON_NONE;
unsigned char state;
static bool hold_button = false;
+ bool hold_button_old;
+
+ /* Hold */
+ hold_button_old = hold_button;
+ hold_button = button_hold();
#ifndef BOOTLOADER
/* light handling */
- if (hold_button && !button_hold())
+ if (hold_button != hold_button_old)
{
backlight_hold_changed(hold_button);
}
#endif
- hold_button = button_hold();
if (!hold_button)
{
/* Read normal buttons */