diff options
| author | Hristo Kovachev <bger@rockbox.org> | 2005-12-22 13:31:14 +0000 |
|---|---|---|
| committer | Hristo Kovachev <bger@rockbox.org> | 2005-12-22 13:31:14 +0000 |
| commit | b1a230353e81863189e0be1603c1ee6fa653485d (patch) | |
| tree | 8a6ff80d5c5d0913032762858071aa40ac120d7f | |
| parent | 9b83c6c4bddca41411d31b8aab17ecc577b37eb4 (diff) | |
| download | rockbox-b1a230353e81863189e0be1603c1ee6fa653485d.zip rockbox-b1a230353e81863189e0be1603c1ee6fa653485d.tar.gz rockbox-b1a230353e81863189e0be1603c1ee6fa653485d.tar.bz2 rockbox-b1a230353e81863189e0be1603c1ee6fa653485d.tar.xz | |
Oops:) Make the brightness setting purely numerical
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8281 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/settings.c | 2 | ||||
| -rw-r--r-- | apps/settings.h | 8 | ||||
| -rw-r--r-- | firmware/backlight.c | 2 | ||||
| -rw-r--r-- | firmware/export/backlight.h | 2 |
4 files changed, 9 insertions, 5 deletions
diff --git a/apps/settings.c b/apps/settings.c index 118692a..8e266b1 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -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. */ diff --git a/apps/settings.h b/apps/settings.h index 870d9ef..4bc0904 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -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 */ diff --git a/firmware/backlight.c b/firmware/backlight.c index d118830..740acd1 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c @@ -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 diff --git a/firmware/export/backlight.h b/firmware/export/backlight.h index f4c62a2..05d395f 100644 --- a/firmware/export/backlight.h +++ b/firmware/export/backlight.h @@ -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 |