mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
Fixed remote contrast settings. Maybe'll get some build errors here.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11071 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
9e92d06dd1
commit
e636492791
8 changed files with 47 additions and 13 deletions
|
|
@ -302,7 +302,8 @@ static const struct bit_entry rtc_bits[] =
|
|||
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
/* remote lcd */
|
||||
{6, S_O(remote_contrast), 42, "remote contrast", NULL },
|
||||
{6, S_O(remote_contrast), DEFAULT_REMOTE_CONTRAST_SETTING,
|
||||
"remote contrast", NULL },
|
||||
{1, S_O(remote_invert), false, "remote invert", off_on },
|
||||
{1, S_O(remote_flip_display), false, "remote flip display", off_on },
|
||||
{5, S_O(remote_backlight_timeout), 6, "remote backlight timeout",
|
||||
|
|
@ -1365,11 +1366,18 @@ void settings_load(int which)
|
|||
#ifdef HAVE_RECORDING
|
||||
global_settings.recscreen_on = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LCD_CONTRAST
|
||||
if ( global_settings.contrast < MIN_CONTRAST_SETTING )
|
||||
if ( global_settings.contrast < MIN_CONTRAST_SETTING ||
|
||||
global_settings.contrast > MAX_CONTRAST_SETTING )
|
||||
global_settings.contrast = lcd_default_contrast();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LCD_REMOTE
|
||||
if (global_settings.remote_contrast < MIN_REMOTE_CONTRAST_SETTING ||
|
||||
global_settings.remote_contrast > MAX_REMOTE_CONTRAST_SETTING )
|
||||
global_settings.remote_contrast = lcd_remote_default_contrast();
|
||||
#endif
|
||||
i = 0xb8;
|
||||
strncpy((char *)global_settings.wps_file, (char *)&config_block[i],
|
||||
MAX_FILENAME);
|
||||
|
|
|
|||
|
|
@ -108,7 +108,6 @@ extern unsigned char vp_dummy[VIRT_SIZE];
|
|||
simplicity. */
|
||||
#if !defined(HAVE_LCD_COLOR)
|
||||
#define HAVE_LCD_CONTRAST
|
||||
#define DEFAULT_CONTRAST_SETTING 40
|
||||
#endif
|
||||
|
||||
struct user_settings
|
||||
|
|
@ -545,6 +544,11 @@ extern const char rec_base_directory[];
|
|||
|
||||
/* system defines */
|
||||
#ifndef TARGET_TREE
|
||||
|
||||
#ifndef HAVE_LCD_COLOR
|
||||
#define DEFAULT_CONTRAST_SETTING 40
|
||||
#endif
|
||||
|
||||
#if defined HAVE_LCD_CHARCELLS
|
||||
#define MIN_CONTRAST_SETTING 5
|
||||
#define MAX_CONTRAST_SETTING 31
|
||||
|
|
@ -552,6 +556,17 @@ extern const char rec_base_directory[];
|
|||
#define MIN_CONTRAST_SETTING 5
|
||||
#define MAX_CONTRAST_SETTING 63
|
||||
#endif
|
||||
|
||||
/* As it was */
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
#ifndef DEFAULT_REMOTE_CONTRAST_SETTING
|
||||
/* May be defined in config file if driver code needs the value */
|
||||
#define DEFAULT_REMOTE_CONTRAST_SETTING 42
|
||||
#endif
|
||||
#define MIN_REMOTE_CONTRAST_SETTING MIN_CONTRAST_SETTING
|
||||
#define MAX_REMOTE_CONTRAST_SETTING MAX_CONTRAST_SETTING
|
||||
#endif
|
||||
|
||||
#endif /* !TARGET_TREE */
|
||||
|
||||
/* argument bits for settings_load() */
|
||||
|
|
|
|||
|
|
@ -124,8 +124,8 @@ static bool remote_contrast(void)
|
|||
{
|
||||
return set_int( str(LANG_CONTRAST), "", UNIT_INT,
|
||||
&global_settings.remote_contrast,
|
||||
lcd_remote_set_contrast, 1, MIN_CONTRAST_SETTING,
|
||||
MAX_CONTRAST_SETTING, NULL );
|
||||
lcd_remote_set_contrast, 1, MIN_REMOTE_CONTRAST_SETTING,
|
||||
MAX_REMOTE_CONTRAST_SETTING, NULL );
|
||||
}
|
||||
|
||||
static bool remote_invert(void)
|
||||
|
|
|
|||
|
|
@ -73,8 +73,6 @@ static int xmargin = 0;
|
|||
static int ymargin = 0;
|
||||
static int curfont = FONT_SYSFIXED;
|
||||
|
||||
#define LCD_REMOTE_DEFAULT_CONTRAST 42;
|
||||
|
||||
#ifndef SIMULATOR
|
||||
static int xoffset; /* needed for flip */
|
||||
|
||||
|
|
@ -99,7 +97,7 @@ static int _remote_type = REMOTETYPE_UNPLUGGED;
|
|||
/* cached settings values */
|
||||
static bool cached_invert = false;
|
||||
static bool cached_flip = false;
|
||||
static int cached_contrast = LCD_REMOTE_DEFAULT_CONTRAST;
|
||||
static int cached_contrast = DEFAULT_REMOTE_CONTRAST_SETTING;
|
||||
#endif
|
||||
|
||||
/* scrolling */
|
||||
|
|
@ -397,7 +395,7 @@ void lcd_remote_write_data(const unsigned char* p_bytes, int count)
|
|||
|
||||
int lcd_remote_default_contrast(void)
|
||||
{
|
||||
return LCD_REMOTE_DEFAULT_CONTRAST;
|
||||
return DEFAULT_REMOTE_CONTRAST_SETTING;
|
||||
}
|
||||
|
||||
#ifndef SIMULATOR
|
||||
|
|
|
|||
|
|
@ -50,6 +50,8 @@
|
|||
|
||||
#define CONFIG_LCD LCD_S1D15E06
|
||||
|
||||
#define DEFAULT_REMOTE_CONTRAST_SETTING 42
|
||||
|
||||
/* Define this for LCD backlight available */
|
||||
#define CONFIG_BACKLIGHT BL_IRIVER_H100 /* port controlled */
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@
|
|||
|
||||
#define CONFIG_LCD LCD_S1D15E06
|
||||
|
||||
#define DEFAULT_REMOTE_CONTRAST_SETTING 42
|
||||
|
||||
/* Define this for LCD backlight available */
|
||||
#define CONFIG_BACKLIGHT BL_IRIVER_H100 /* port controlled */
|
||||
|
||||
|
|
|
|||
|
|
@ -47,10 +47,16 @@
|
|||
|
||||
#define CONFIG_LCD LCD_X5
|
||||
|
||||
/* Main LCD contrast range and defaults */
|
||||
#define MIN_CONTRAST_SETTING 1
|
||||
#define MAX_CONTRAST_SETTING 30
|
||||
#define DEFAULT_CONTRAST_SETTING 19 /* Match boot contrast */
|
||||
|
||||
/* Remote LCD contrast range and defaults */
|
||||
#define MIN_REMOTE_CONTRAST_SETTING 10
|
||||
#define MAX_REMOTE_CONTRAST_SETTING 35
|
||||
#define DEFAULT_REMOTE_CONTRAST_SETTING 24 /* Match boot contrast */
|
||||
|
||||
/* Define this for LCD backlight available */
|
||||
#define CONFIG_BACKLIGHT BL_X5 /* PCF50606 I2C */
|
||||
#define HAVE_BACKLIGHT_BRIGHTNESS
|
||||
|
|
|
|||
|
|
@ -51,12 +51,10 @@
|
|||
#define RS_LO and_l(~0x00008000, &GPIO_OUT)
|
||||
#define RS_HI or_l(0x00008000, &GPIO_OUT)
|
||||
|
||||
#define LCD_REMOTE_DEFAULT_CONTRAST 0x18;
|
||||
|
||||
/* cached settings values */
|
||||
static bool cached_invert = false;
|
||||
static bool cached_flip = false;
|
||||
static int cached_contrast = LCD_REMOTE_DEFAULT_CONTRAST;
|
||||
static int cached_contrast = DEFAULT_REMOTE_CONTRAST_SETTING;
|
||||
|
||||
bool remote_initialized = false;
|
||||
|
||||
|
|
@ -294,7 +292,7 @@ void lcd_remote_write_data(const unsigned char* p_bytes, int count)
|
|||
|
||||
int lcd_remote_default_contrast(void)
|
||||
{
|
||||
return LCD_REMOTE_DEFAULT_CONTRAST;
|
||||
return DEFAULT_REMOTE_CONTRAST_SETTING;
|
||||
}
|
||||
|
||||
void lcd_remote_powersave(bool on)
|
||||
|
|
@ -309,6 +307,11 @@ void lcd_remote_powersave(bool on)
|
|||
|
||||
void lcd_remote_set_contrast(int val)
|
||||
{
|
||||
if (val < 0)
|
||||
val = 0;
|
||||
else if (val > 63)
|
||||
val = 63;
|
||||
|
||||
cached_contrast = val;
|
||||
if(remote_initialized)
|
||||
lcd_remote_write_command_ex(LCD_SET_VOLUME, val);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue