summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-04-24 07:14:16 +0000
committerJens Arnold <amiconn@rockbox.org>2006-04-24 07:14:16 +0000
commit67604c960b8e467de980b31e4ee9ea8d025b4d7c (patch)
tree22f412a371b1cf816b2e60ff67c470a4a829e4fa /firmware/drivers
parent1aae0a0e8c09c4b95da0d94f44ad1524f6f2d8c1 (diff)
Ipods, X5: Proper backlight behaviour on buton unlock.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9788 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/button.c25
1 files changed, 25 insertions, 0 deletions
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();