Fix simulator brightness calculation in case MIN_BRIGHTNESS_SETTING != 1

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30870 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Bertrik Sikken 2011-10-30 20:06:30 +00:00
parent 10832b8c1c
commit 539fb71b9d

View file

@ -41,7 +41,8 @@ bool _backlight_init(void)
static inline int normalize_backlight(int val)
{
/* normalize to xx% brightness for sdl */
return ((val - MIN_BRIGHTNESS_SETTING + 1) * 100)/MAX_BRIGHTNESS_SETTING;
return ((val - MIN_BRIGHTNESS_SETTING + 1) * 100) /
(MAX_BRIGHTNESS_SETTING - MIN_BRIGHTNESS_SETTING + 1);
}
void _backlight_set_brightness(int val)