summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 */