From 67604c960b8e467de980b31e4ee9ea8d025b4d7c Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Mon, 24 Apr 2006 07:14:16 +0000 Subject: [PATCH] Ipods, X5: Proper backlight behaviour on buton unlock. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9788 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/button.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 3286760aa6..6513fb4a3a 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -1212,11 +1212,29 @@ static int button_read(void) btn |= BUTTON_ON; #elif (CONFIG_KEYPAD == IPOD_4G_PAD) + static bool hold_button = false; + + /* light handling */ + if (hold_button && !button_hold()) + { + backlight_on(); + } + hold_button = button_hold(); + (void)data; /* The int_btn variable is set in the button interrupt handler */ btn = int_btn; #elif (CONFIG_KEYPAD == IPOD_3G_PAD) + static bool hold_button = false; + + /* light handling */ + if (hold_button && !button_hold()) + { + backlight_on(); + } + hold_button = button_hold(); + (void)data; btn = ipod_3g_button_read(); @@ -1224,6 +1242,13 @@ static int button_read(void) static bool hold_button = false; static bool remote_hold_button = false; + /* light handling */ + if (hold_button && !button_hold()) + { + backlight_on(); + } + /* TODO: add light handling for the remote */ + hold_button = button_hold(); remote_hold_button = remote_button_hold();