summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/target/hosted/sdl/lcd-bitmap.c8
-rw-r--r--uisimulator/common/lcd-common.c3
2 files changed, 11 insertions, 0 deletions
diff --git a/firmware/target/hosted/sdl/lcd-bitmap.c b/firmware/target/hosted/sdl/lcd-bitmap.c
index 5f895d802d..aefbb17b42 100644
--- a/firmware/target/hosted/sdl/lcd-bitmap.c
+++ b/firmware/target/hosted/sdl/lcd-bitmap.c
@@ -162,7 +162,15 @@ void sim_backlight(int value)
162#endif 162#endif
163 } 163 }
164#else /* LCD_DEPTH > 8 */ 164#else /* LCD_DEPTH > 8 */
165#ifdef HAVE_TRANSFLECTIVE_LCD
166 if (!lcd_active())
167 SDL_SetAlpha(lcd_surface, SDL_SRCALPHA, 0);
168 else
169 SDL_SetAlpha(lcd_surface, SDL_SRCALPHA,
170 MAX(BACKLIGHT_OFF_ALPHA, (value * 255) / 100));
171#else
165 SDL_SetAlpha(lcd_surface, SDL_SRCALPHA, (value * 255) / 100); 172 SDL_SetAlpha(lcd_surface, SDL_SRCALPHA, (value * 255) / 100);
173#endif
166#endif /* LCD_DEPTH */ 174#endif /* LCD_DEPTH */
167 175
168 sdl_gui_update(lcd_surface, 0, 0, SIM_LCD_WIDTH, SIM_LCD_HEIGHT, 176 sdl_gui_update(lcd_surface, 0, 0, SIM_LCD_WIDTH, SIM_LCD_HEIGHT,
diff --git a/uisimulator/common/lcd-common.c b/uisimulator/common/lcd-common.c
index 47ca114cbc..9e01f3eda6 100644
--- a/uisimulator/common/lcd-common.c
+++ b/uisimulator/common/lcd-common.c
@@ -78,6 +78,9 @@ void lcd_remote_set_invert_display(bool invert)
78void lcd_sleep(void) 78void lcd_sleep(void)
79{ 79{
80 lcd_sleeping = true; 80 lcd_sleeping = true;
81#ifdef HAVE_TRANSFLECTIVE_LCD
82 sim_backlight(0); /* completely blacken the screen */
83#endif
81} 84}
82 85
83void lcd_awake(void) 86void lcd_awake(void)