Ensure brightness > 0 in ExtUI (#17611)

This commit is contained in:
RudolphRiedel 2020-04-20 14:03:00 +02:00 committed by GitHub
parent 1af6a6d4f9
commit 27f0f10590
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -158,6 +158,8 @@ void InterfaceSettingsScreen::onIdle() {
switch (cmd.track_tag(value)) { switch (cmd.track_tag(value)) {
case 2: case 2:
screen_data.InterfaceSettingsScreen.brightness = float(value) * 128 / 0xFFFF; screen_data.InterfaceSettingsScreen.brightness = float(value) * 128 / 0xFFFF;
if (screen_data.InterfaceSettingsScreen.brightness > 1)
screen_data.InterfaceSettingsScreen.brightness = 1;
CLCD::set_brightness(screen_data.InterfaceSettingsScreen.brightness); CLCD::set_brightness(screen_data.InterfaceSettingsScreen.brightness);
SaveSettingsDialogBox::settingsChanged(); SaveSettingsDialogBox::settingsChanged();
break; break;