From a04b1d418d18fe9a889eb149d65c3854833b1255 Mon Sep 17 00:00:00 2001 From: Magnus Holmgren Date: Wed, 23 Nov 2005 21:50:09 +0000 Subject: [PATCH] iriver: only show remote lock icon if remote is locked and plugged. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8057 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/button.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 2802d9f0ac..d77c3e9b9d 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -58,6 +58,7 @@ static bool flipped; /* buttons can be flipped to match the LCD flip */ #define POWEROFF_COUNT 10 static int button_read(void); +static bool remote_button_hold_only(void); static void button_tick(void) { @@ -387,13 +388,13 @@ static int button_read(void) { backlight_on(); } - if (remote_hold_button && !remote_button_hold()) + if (remote_hold_button && !remote_button_hold_only()) { remote_backlight_on(); } hold_button = button_hold(); - remote_hold_button = remote_button_hold(); + remote_hold_button = remote_button_hold_only(); /* normal buttons */ if (!hold_button) @@ -478,13 +479,13 @@ static int button_read(void) { backlight_on(); } - if (remote_hold_button && !remote_button_hold()) + if (remote_hold_button && !remote_button_hold_only()) { remote_backlight_on(); } hold_button = button_hold(); - remote_hold_button = remote_button_hold(); + remote_hold_button = remote_button_hold_only(); /* normal buttons */ if (!hold_button) @@ -696,10 +697,15 @@ bool button_hold(void) return (GPIO1_READ & 0x00000002)?true:false; } -bool remote_button_hold(void) +static bool remote_button_hold_only(void) { return (GPIO1_READ & 0x00100000)?true:false; } + +bool remote_button_hold(void) +{ + return ((GPIO_READ & 0x40000000) == 0)?remote_button_hold_only():false; +} #endif int button_status(void)