diff options
| author | Magnus Holmgren <magnushol@gmail.com> | 2005-11-23 21:50:09 +0000 |
|---|---|---|
| committer | Magnus Holmgren <magnushol@gmail.com> | 2005-11-23 21:50:09 +0000 |
| commit | a04b1d418d18fe9a889eb149d65c3854833b1255 (patch) | |
| tree | 2925801e9c44cb549a9411f7392770d9f9a2a204 | |
| parent | 3e8b9f6915264f499042234d1b931a9a815ced73 (diff) | |
| download | rockbox-a04b1d418d18fe9a889eb149d65c3854833b1255.zip rockbox-a04b1d418d18fe9a889eb149d65c3854833b1255.tar.gz rockbox-a04b1d418d18fe9a889eb149d65c3854833b1255.tar.bz2 rockbox-a04b1d418d18fe9a889eb149d65c3854833b1255.tar.xz | |
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
| -rw-r--r-- | firmware/drivers/button.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 2802d9f..d77c3e9 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) |