summaryrefslogtreecommitdiff
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 @@
33 33
34void button_init_device(void) 34void button_init_device(void)
35{ 35{
36 /* Enable REW, FF, Play, Left, Right, Hold buttons */
37 GPIOA_ENABLE |= 0xfc;
38
39 /* Enable POWER button */
40 GPIOB_ENABLE |= 0x1;
41
36 /* We need to output to pin 6 of GPIOD when reading the scroll pad value */ 42 /* We need to output to pin 6 of GPIOD when reading the scroll pad value */
43 GPIOD_ENABLE |= 0x40;
37 GPIOD_OUTPUT_EN |= 0x40; 44 GPIOD_OUTPUT_EN |= 0x40;
38 GPIOD_OUTPUT_VAL |= 0x40; 45 GPIOD_OUTPUT_VAL |= 0x40;
39} 46}
@@ -51,16 +58,20 @@ int button_read_device(void)
51 int btn = BUTTON_NONE; 58 int btn = BUTTON_NONE;
52 unsigned char state; 59 unsigned char state;
53 static bool hold_button = false; 60 static bool hold_button = false;
61 bool hold_button_old;
62
63 /* Hold */
64 hold_button_old = hold_button;
65 hold_button = button_hold();
54 66
55#ifndef BOOTLOADER 67#ifndef BOOTLOADER
56 /* light handling */ 68 /* light handling */
57 if (hold_button && !button_hold()) 69 if (hold_button != hold_button_old)
58 { 70 {
59 backlight_hold_changed(hold_button); 71 backlight_hold_changed(hold_button);
60 } 72 }
61#endif 73#endif
62 74
63 hold_button = button_hold();
64 if (!hold_button) 75 if (!hold_button)
65 { 76 {
66 /* Read normal buttons */ 77 /* Read normal buttons */