From 0b1ae73d3af28815169765be9cd50c9c0020594f Mon Sep 17 00:00:00 2001 From: Barry Wardell Date: Wed, 13 Sep 2006 23:38:16 +0000 Subject: 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 --- firmware/target/arm/iriver/h10/button-h10.c | 15 +++++++++++++-- 1 file 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 */ -- cgit v1.2.3