From c657763a23797238b4f95f7d52ac4902fd05f306 Mon Sep 17 00:00:00 2001 From: Rani Hod Date: Sun, 23 Jul 2006 22:18:32 +0000 Subject: Accepted FS #5474 by yours truly. Save your settings; CONFIG_BLOCK_VERSION is increased. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10303 a1c6a512-1295-4272-9138-f99709370657 --- firmware/backlight.c | 2 +- firmware/export/config-iaudiox5.h | 3 ++- firmware/target/coldfire/iaudio/x5/lcd-x5.c | 11 ++++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'firmware') diff --git a/firmware/backlight.c b/firmware/backlight.c index 76ffc6f0e4..8568c98829 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c @@ -655,7 +655,7 @@ bool is_remote_backlight_on(void) {return true;} #endif /* #ifdef CONFIG_BACKLIGHT */ #ifdef HAVE_BACKLIGHT_BRIGHTNESS -#ifdef IRIVER_H300_SERIES +#if defined(IRIVER_H300_SERIES) || defined(IAUDIO_X5) void backlight_set_brightness(int val) { /* set H300 brightness by changing the PWM diff --git a/firmware/export/config-iaudiox5.h b/firmware/export/config-iaudiox5.h index a04967c455..7ce230ee8e 100644 --- a/firmware/export/config-iaudiox5.h +++ b/firmware/export/config-iaudiox5.h @@ -42,7 +42,8 @@ #define CONFIG_LCD LCD_X5 /* Define this for LCD backlight available */ -#define CONFIG_BACKLIGHT BL_IRIVER_H100 /* port controlled */ +#define CONFIG_BACKLIGHT BL_IRIVER_H100 /* port controlled !?!? */ +#define HAVE_BACKLIGHT_BRIGHTNESS /* Define this if you have a software controlled poweroff */ #define HAVE_SW_POWEROFF diff --git a/firmware/target/coldfire/iaudio/x5/lcd-x5.c b/firmware/target/coldfire/iaudio/x5/lcd-x5.c index 75ec2462be..1adcf6aaea 100755 --- a/firmware/target/coldfire/iaudio/x5/lcd-x5.c +++ b/firmware/target/coldfire/iaudio/x5/lcd-x5.c @@ -38,8 +38,8 @@ static bool display_on=false; /* is the display turned on? */ /* register defines for the Renesas HD66773R */ #define R_HORIZ_RAM_ADDR_POS 0x16 #define R_VERT_RAM_ADDR_POS 0x17 -#define R_RAM_ADDR_SET 0x21 -#define R_WRITE_DATA_2_GRAM 0x22 +#define R_RAM_ADDR_SET 0x21 +#define R_WRITE_DATA_2_GRAM 0x22 /***************************************************** The table below was generated by the following script: @@ -139,7 +139,12 @@ inline void lcd_write_data(const unsigned short* p_bytes, int count) void lcd_set_contrast(int val) { - (void)val; + if (val >= 15) // val must'nt be 15 or 31 + ++val; + if (val > 30) + return; + + lcd_write_reg(0x0e, 0x201e + (val << 8)); } void lcd_set_invert_display(bool yesno) -- cgit v1.2.3