summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tmk_core/common/backlight.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tmk_core/common/backlight.c b/tmk_core/common/backlight.c
index 0e0ad2d154..d03bfe931b 100644
--- a/tmk_core/common/backlight.c
+++ b/tmk_core/common/backlight.c
@@ -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);
}