1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-23 12:04:19 +00:00

Fix ExtUI 0<brightness<12 (#17644)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
RudolphRiedel 2020-04-22 23:47:29 +02:00 committed by GitHub
parent c3aeed0dcc
commit f263787f07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -157,9 +157,7 @@ void InterfaceSettingsScreen::onIdle() {
CommandProcessor cmd;
switch (cmd.track_tag(value)) {
case 2:
screen_data.InterfaceSettingsScreen.brightness = float(value) * 128 / 0xFFFF;
if (screen_data.InterfaceSettingsScreen.brightness > 1)
screen_data.InterfaceSettingsScreen.brightness = 1;
screen_data.InterfaceSettingsScreen.brightness = constrain((value * 128UL) / 0xFFFF, 1, 11);
CLCD::set_brightness(screen_data.InterfaceSettingsScreen.brightness);
SaveSettingsDialogBox::settingsChanged();
break;