mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
Oops:) Make the brightness setting purely numerical
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8281 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
9b83c6c4bd
commit
b1a230353e
4 changed files with 9 additions and 5 deletions
|
|
@ -489,7 +489,7 @@ static const struct bit_entry hd_bits[] =
|
|||
{4, S_O(default_codepage), 0, "default codepage", "iso8859-1,iso8859-7,iso8859-8,cp1251,iso8859-11,iso8859-6,iso8859-9,iso8859-2,sjis,gb2312,ksx1001,big5,utf-8" },
|
||||
|
||||
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
|
||||
{4, S_O(brightness), 9, "brightness", "2,3,4,5,6,7,8,9,10,11,12,13,14,15"},
|
||||
{4, S_O(brightness), 9, "brightness", NULL },
|
||||
#endif
|
||||
|
||||
/* If values are just added to the end, no need to bump the version. */
|
||||
|
|
|
|||
|
|
@ -27,6 +27,10 @@
|
|||
#include "timefuncs.h"
|
||||
#include "abrepeat.h"
|
||||
|
||||
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
|
||||
#include "backlight.h" /* for [MIN|MAX]_BRIGHTNESS_SETTING */
|
||||
#endif
|
||||
|
||||
#define ROCKBOX_DIR "/.rockbox"
|
||||
#define ROCKBOX_DIR_LEN 9
|
||||
#define FONT_DIR "/fonts"
|
||||
|
|
@ -446,10 +450,6 @@ extern const char rec_base_directory[];
|
|||
#endif
|
||||
#define MIN_CONTRAST_SETTING 5
|
||||
|
||||
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
|
||||
#define MIN_BRIGHTNESS_SETTING 2
|
||||
#define MAX_BRIGHTNESS_SETTING 15
|
||||
#endif
|
||||
|
||||
/* argument bits for settings_load() */
|
||||
#define SETTINGS_RTC 1 /* only the settings from the RTC nonvolatile RAM */
|
||||
|
|
|
|||
|
|
@ -548,6 +548,8 @@ void backlight_set_brightness(int val)
|
|||
/* set H300 brightness by changing the PWM
|
||||
accepts 0..15 but note that 0 and 1 give a black display! */
|
||||
unsigned char ucVal = (unsigned char)(val & 0x0F);
|
||||
if(val<MIN_BRIGHTNESS_SETTING)
|
||||
val=MIN_BRIGHTNESS_SETTING;
|
||||
pcf50606_set_bl_pwm(ucVal);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -51,5 +51,7 @@ void sim_remote_backlight(int value);
|
|||
#endif
|
||||
|
||||
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
|
||||
#define MIN_BRIGHTNESS_SETTING 2
|
||||
#define MAX_BRIGHTNESS_SETTING 15
|
||||
void backlight_set_brightness(int val);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue