From e63649279186e119614b9ca892bcfa27e6af8337 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Tue, 26 Sep 2006 20:46:17 +0000 Subject: 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 --- firmware/drivers/lcd-h100-remote.c | 6 ++---- firmware/export/config-h100.h | 2 ++ firmware/export/config-h120.h | 2 ++ firmware/export/config-iaudiox5.h | 6 ++++++ firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c | 11 +++++++---- 5 files changed, 19 insertions(+), 8 deletions(-) (limited to 'firmware') diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c index a200c7bcb1..75d42f8371 100644 --- a/firmware/drivers/lcd-h100-remote.c +++ b/firmware/drivers/lcd-h100-remote.c @@ -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 diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h index aacb30dd44..71baa83100 100644 --- a/firmware/export/config-h100.h +++ b/firmware/export/config-h100.h @@ -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 */ diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h index 79ad613968..e6aa822376 100644 --- a/firmware/export/config-h120.h +++ b/firmware/export/config-h120.h @@ -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 */ diff --git a/firmware/export/config-iaudiox5.h b/firmware/export/config-iaudiox5.h index c3cd157781..83f0767723 100644 --- a/firmware/export/config-iaudiox5.h +++ b/firmware/export/config-iaudiox5.h @@ -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 diff --git a/firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c b/firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c index 46e1eba1fd..6e3bb01a15 100755 --- a/firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c +++ b/firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c @@ -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); -- cgit v1.2.3