Make sure that the backlight level is within the right range

master
Fred Sundvik 2017-06-16 02:02:38 +03:00
parent 7d5606085f
commit ec88a0b3cc
1 changed files with 3 additions and 0 deletions

View File

@ -28,6 +28,9 @@ void backlight_init(void)
eeconfig_init();
}
backlight_config.raw = eeconfig_read_backlight();
if (backlight_config.level > BACKLIGHT_LEVELS) {
backlight_config.level = BACKLIGHT_LEVELS;
}
backlight_set(backlight_config.enable ? backlight_config.level : 0);
}