Skip to content

Commit

Permalink
- simple_display: more readability in togglePower() function
Browse files Browse the repository at this point in the history
Signed-off-by: Thilo Graf <[email protected]>
  • Loading branch information
svenhoefer authored and dbt1 committed Nov 1, 2017
1 parent dbce194 commit 0fac120
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/driver/simple_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 0fac120

Please sign in to comment.