Fix lcd not waking up when backlight is always off
This patch is relevant for targets with a transflective display.
If the backlight was set to "always off" (e.g. to use the lcd
in a pure passive way), and the sleep timer ran off, the LCD
would stay disabled and didn't wake up when a button is pressed.
Change-Id: I0a157c7f421d9fc4c7d8ba903f2cf93f6cef51d0
diff --git a/firmware/backlight.c b/firmware/backlight.c
index 3acc89c..caff55c 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -499,6 +499,10 @@
if (UNLIKELY(timeout < 0))
{
do_backlight_off();
+#if defined(HAVE_TRANSFLECTIVE_LCD) && defined(HAVE_LCD_SLEEP)
+ /* LCD must be enabled to allow "passive" operation (backlight always off) */
+ lcd_awake();
+#endif
#if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_SETTING) \
|| (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_HW_REG)
/* necessary step to issue fading down when the setting is selected */
diff --git a/firmware/export/backlight.h b/firmware/export/backlight.h
index 6d02979..326de4c 100644
--- a/firmware/export/backlight.h
+++ b/firmware/export/backlight.h
@@ -64,6 +64,10 @@
void lcd_awake(void);
#endif
+#ifdef HAVE_LCD_SLEEP
+void lcd_awake(void);
+#endif
+
#else /* !HAVE_BACKLIGHT */
#define backlight_init()
#endif /* !HAVE_BACKLIGHT */