瀏覽代碼

Make sure that the backlight level is within the right range

Fred Sundvik 8 年之前
父節點
當前提交
ec88a0b3cc
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      tmk_core/common/backlight.c

+ 3 - 0
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);
 }