From 787ae82d87666e39e430ba67adeee277007ff81a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 1 Nov 2017 13:00:33 +0100 Subject: [PATCH] simple_display: more readability in togglePower() function Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0fac12001ee2c14d2bc56ff05aa0192045061665 Author: vanhofen Date: 2017-11-01 (Wed, 01 Nov 2017) Origin message was: ------------------ - simple_display: more readability in togglePower() function Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/driver/simple_display.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/driver/simple_display.cpp b/src/driver/simple_display.cpp index 48b0f2b38..347ff46ea 100644 --- a/src/driver/simple_display.cpp +++ b/src/driver/simple_display.cpp @@ -623,10 +623,17 @@ void CLCD::togglePower(void) Clear(); else showTime(true); - if (g_info.hw_caps->display_type == HW_DISPLAY_LINE_TEXT) { + + if (g_info.hw_caps->display_type == HW_DISPLAY_LINE_TEXT) + { last_toggle_state_power = 1 - last_toggle_state_power; - setlcdparameter((mode == MODE_STANDBY) ? g_settings.lcd_setting[SNeutrinoSettings::LCD_STANDBY_BRIGHTNESS] : (mode == MODE_SHUTDOWN) ? g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS] : g_settings.lcd_setting[SNeutrinoSettings::LCD_BRIGHTNESS], - last_toggle_state_power); + + if (mode == MODE_STANDBY) + setlcdparameter(g_settings.lcd_setting[SNeutrinoSettings::LCD_STANDBY_BRIGHTNESS], last_toggle_state_power); + else if (mode == MODE_SHUTDOWN) + setlcdparameter(g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS], last_toggle_state_power); + else + setlcdparameter(g_settings.lcd_setting[SNeutrinoSettings::LCD_BRIGHTNESS], last_toggle_state_power); } }