From 72781630876fe4637d3ab24e12f12239c7216d53 Mon Sep 17 00:00:00 2001 From: Michael Giacomelli Date: Sun, 18 Jan 2009 18:43:58 +0000 Subject: Commit part 1 of FS#9663 by Thomas Martitz. Enables backlight fading on the Fuze and e200v2. Also removed a bit of dead code that was copied by accident into the fuze and e200v2 config files. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19791 a1c6a512-1295-4272-9138-f99709370657 --- firmware/backlight.c | 6 +++--- firmware/export/config-e200v2.h | 11 ++++++----- firmware/export/config-fuze.h | 11 ++++++----- firmware/target/arm/as3525/backlight-e200v2-fuze.c | 7 +++---- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/firmware/backlight.c b/firmware/backlight.c index 66cc6df..f0a0bb5 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c @@ -463,9 +463,9 @@ static void backlight_set_up_fade_down(void) _backlight_off(); /* h300/x5/d2 go to the last known brightness level at backight_on(),which * should be the lowest level to keep fading up glitch free - * sansa e200/c200 make the backlight on only by setting the brightness, - * so this step would be noticeable */ -#if !defined(SANSA_E200) && !defined(SANSA_C200) + * targets which set brightness over AS3514 I2C make the backlight on only + * by setting the brightness, so this step would be noticeable */ +#if !defined(HAVE_AS3514) _backlight_set_brightness(MIN_BRIGHTNESS_SETTING); #endif } diff --git a/firmware/export/config-e200v2.h b/firmware/export/config-e200v2.h index 08a672b..5b6ac5f 100644 --- a/firmware/export/config-e200v2.h +++ b/firmware/export/config-e200v2.h @@ -134,6 +134,12 @@ /** Non-simulator section **/ #ifndef SIMULATOR +/* define this if the backlight thread is used for fade, not for sim, needs + * HAVE_BACKLIGHT_BRIGHTNESS */ +#ifndef BOOTLOADER +#define USE_BACKLIGHT_SW_FADING +#endif + /* Define this if you have an AMS AS3525*/ #define CONFIG_CPU AS3525 @@ -200,8 +206,3 @@ #define DEFAULT_REC_MIC_GAIN 23 #define DEFAULT_REC_LEFT_GAIN 23 #define DEFAULT_REC_RIGHT_GAIN 23 - -#ifdef E200R_INSTALLER -#define IRAMORIG 0x40004000 -#endif - diff --git a/firmware/export/config-fuze.h b/firmware/export/config-fuze.h index 5607e4a..e79abb1 100644 --- a/firmware/export/config-fuze.h +++ b/firmware/export/config-fuze.h @@ -134,6 +134,12 @@ /** Non-simulator section **/ #ifndef SIMULATOR +/* define this if the backlight thread is used for fade, not for sim, needs + * HAVE_BACKLIGHT_BRIGHTNESS */ +#ifndef BOOTLOADER +#define USE_BACKLIGHT_SW_FADING +#endif + /* Define this if you have an AMS AS3525*/ #define CONFIG_CPU AS3525 @@ -200,8 +206,3 @@ #define DEFAULT_REC_MIC_GAIN 23 #define DEFAULT_REC_LEFT_GAIN 23 #define DEFAULT_REC_RIGHT_GAIN 23 - -#ifdef E200R_INSTALLER -#define IRAMORIG 0x40004000 -#endif - diff --git a/firmware/target/arm/as3525/backlight-e200v2-fuze.c b/firmware/target/arm/as3525/backlight-e200v2-fuze.c index 2c0aad2..c642064 100644 --- a/firmware/target/arm/as3525/backlight-e200v2-fuze.c +++ b/firmware/target/arm/as3525/backlight-e200v2-fuze.c @@ -28,10 +28,7 @@ void _backlight_set_brightness(int brightness) { - if (brightness > 0) - _backlight_on(); - else - _backlight_off(); + ascodec_write(AS3514_DCDC15, brightness); } void _backlight_on(void) @@ -42,7 +39,9 @@ void _backlight_on(void) #ifdef HAVE_LCD_ENABLE lcd_enable(true); /* power on lcd + visible display */ #endif +#ifndef USE_BACKLIGHT_SW_FADING ascodec_write(AS3514_DCDC15, backlight_brightness); +#endif } void _backlight_off(void) -- cgit v1.1