diff options
| author | Sebastian Leonhardt <sebastian.leonhardt@web.de> | 2016-06-29 23:18:00 +0200 |
|---|---|---|
| committer | Solomon Peachy <pizza@shaftnet.org> | 2019-02-07 22:56:39 +0100 |
| commit | 053c4d0593ea1dc5974bf0cc4c08ffc3db65c30e (patch) | |
| tree | ac8e69a183c41e0930baa3c739d5634900ba6647 | |
| parent | 666405f346bef501a6707c4b152704f5c34246c6 (diff) | |
| download | rockbox-053c4d0593ea1dc5974bf0cc4c08ffc3db65c30e.zip rockbox-053c4d0593ea1dc5974bf0cc4c08ffc3db65c30e.tar.gz rockbox-053c4d0593ea1dc5974bf0cc4c08ffc3db65c30e.tar.bz2 rockbox-053c4d0593ea1dc5974bf0cc4c08ffc3db65c30e.tar.xz | |
transflective LCDs: fix "first buttonpress enables backlight only"
This should be done even if the backlight is set to "always off",
i.e. if the LCD is sleeping, a button press should be "eaten"
and just wake up the LCD.
Change-Id: I3946bdbbdc81f23eae3f47423123cefa275e0afc
| -rw-r--r-- | firmware/drivers/button.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 608fe7e..9677580 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -41,6 +41,9 @@ #ifdef HAVE_REMOTE_LCD #include "lcd-remote.h" #endif +#if defined(HAVE_TRANSFLECTIVE_LCD) && defined(HAVE_LCD_SLEEP) +#include "lcd.h" /* lcd_active() prototype */ +#endif struct event_queue button_queue SHAREDBSS_ATTR; @@ -354,7 +357,12 @@ static void button_tick(void) } else #endif - if (!filter_first_keypress || is_backlight_on(false) + if (!filter_first_keypress +#if defined(HAVE_TRANSFLECTIVE_LCD) && defined(HAVE_LCD_SLEEP) + || (is_backlight_on(false) && lcd_active()) +#else + || is_backlight_on(false) +#endif #if BUTTON_REMOTE || (btn & BUTTON_REMOTE) #endif |