From ec88a0b3ccfdd22373a707e084202f1f1cf481b2 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Fri, 16 Jun 2017 02:02:38 +0300 Subject: Make sure that the backlight level is within the right range --- tmk_core/common/backlight.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tmk_core/common') 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); } -- cgit v1.2.3