diff options
-rw-r--r-- | firmware/backlight.c | 10 | ||||
-rw-r--r-- | firmware/export/backlight.h | 3 | ||||
-rw-r--r-- | firmware/export/config-c200.h | 2 | ||||
-rw-r--r-- | firmware/export/config-cowond2.h | 2 | ||||
-rw-r--r-- | firmware/export/config-e200.h | 2 | ||||
-rw-r--r-- | firmware/export/config-h300.h | 3 | ||||
-rw-r--r-- | firmware/export/config-iaudiox5.h | 5 | ||||
-rw-r--r-- | firmware/target/arm/as3525/backlight-e200v2-fuze.c | 4 | ||||
-rw-r--r-- | firmware/target/arm/as3525/sansa-fuze/backlight-target.h | 1 | ||||
-rw-r--r-- | firmware/target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c | 9 |
10 files changed, 19 insertions, 22 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c index fe9c215af5..1208973944 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c @@ -48,6 +48,10 @@ #define BACKLIGHT_FULL_INIT #endif +#ifdef HAVE_BACKLIGHT_BRIGHTNESS +int backlight_brightness = DEFAULT_BRIGHTNESS_SETTING; +#endif + #ifdef USE_BACKLIGHT_SW_FADING #include "backlight-thread-fading.h" #endif @@ -139,10 +143,6 @@ static int backlight_timeout_plugged = 5*HZ; static int backlight_on_button_hold = 0; #endif -#ifdef HAVE_BACKLIGHT_BRIGHTNESS -int backlight_brightness = DEFAULT_BRIGHTNESS_SETTING; -#endif - #ifdef HAVE_BUTTON_LIGHT static int buttonlight_timer; int _buttonlight_timeout = 5*HZ; @@ -928,8 +928,8 @@ void backlight_set_brightness(int val) else if (val > MAX_BRIGHTNESS_SETTING) val = MAX_BRIGHTNESS_SETTING; - _backlight_set_brightness(val); backlight_brightness = val; + _backlight_set_brightness(val); #ifdef USE_BACKLIGHT_SW_FADING /* receive backlight brightness */ _backlight_fade_update_state(val); diff --git a/firmware/export/backlight.h b/firmware/export/backlight.h index a177fe740f..506a9f6b03 100644 --- a/firmware/export/backlight.h +++ b/firmware/export/backlight.h @@ -43,8 +43,6 @@ void backlight_set_fade_in(bool value); void backlight_set_fade_out(bool value); #endif -extern int backlight_brightness; - void backlight_set_timeout_plugged(int value); #ifdef HAS_BUTTON_HOLD @@ -82,6 +80,7 @@ void sim_remote_backlight(int value); #endif #ifdef HAVE_BACKLIGHT_BRIGHTNESS +extern int backlight_brightness; void backlight_set_brightness(int val); #endif /* HAVE_BACKLIGHT_BRIGHTNESS */ diff --git a/firmware/export/config-c200.h b/firmware/export/config-c200.h index 8e26585e94..e169606510 100644 --- a/firmware/export/config-c200.h +++ b/firmware/export/config-c200.h @@ -134,7 +134,9 @@ /* 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 a PortalPlayer PP5024 */ #define CONFIG_CPU PP5022 diff --git a/firmware/export/config-cowond2.h b/firmware/export/config-cowond2.h index b723201340..c6e4555f18 100644 --- a/firmware/export/config-cowond2.h +++ b/firmware/export/config-cowond2.h @@ -124,7 +124,9 @@ /* 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 a TCC7801 */ #define CONFIG_CPU TCC7801 diff --git a/firmware/export/config-e200.h b/firmware/export/config-e200.h index d9bebef9bc..3cae14cc87 100644 --- a/firmware/export/config-e200.h +++ b/firmware/export/config-e200.h @@ -131,7 +131,9 @@ /* 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 a PortalPlayer PP5024 */ #define CONFIG_CPU PP5024 diff --git a/firmware/export/config-h300.h b/firmware/export/config-h300.h index 2af426f048..680ca91245 100644 --- a/firmware/export/config-h300.h +++ b/firmware/export/config-h300.h @@ -116,8 +116,9 @@ /* 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 your LCD can be enabled/disabled */ #define HAVE_LCD_ENABLE diff --git a/firmware/export/config-iaudiox5.h b/firmware/export/config-iaudiox5.h index 089d219534..03b84606c9 100644 --- a/firmware/export/config-iaudiox5.h +++ b/firmware/export/config-iaudiox5.h @@ -124,8 +124,11 @@ #ifndef SIMULATOR -/* define this if the backlight thread is used for fade, not for sim */ +/* 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 your LCD can set contrast */ #define HAVE_LCD_CONTRAST diff --git a/firmware/target/arm/as3525/backlight-e200v2-fuze.c b/firmware/target/arm/as3525/backlight-e200v2-fuze.c index 2b724b34a3..2c0aad27ab 100644 --- a/firmware/target/arm/as3525/backlight-e200v2-fuze.c +++ b/firmware/target/arm/as3525/backlight-e200v2-fuze.c @@ -26,12 +26,8 @@ #include "ascodec-target.h" #include "as3514.h" -static unsigned short backlight_brightness = DEFAULT_BRIGHTNESS_SETTING; - void _backlight_set_brightness(int brightness) { - backlight_brightness = brightness; - if (brightness > 0) _backlight_on(); else diff --git a/firmware/target/arm/as3525/sansa-fuze/backlight-target.h b/firmware/target/arm/as3525/sansa-fuze/backlight-target.h index ddaa7f2094..2d60ac35c2 100644 --- a/firmware/target/arm/as3525/sansa-fuze/backlight-target.h +++ b/firmware/target/arm/as3525/sansa-fuze/backlight-target.h @@ -25,7 +25,6 @@ void _backlight_on(void); void _backlight_off(void); void _backlight_set_brightness(int brightness); -int __backlight_is_on(void); #ifdef HAVE_BUTTON_LIGHT void _buttonlight_on(void); void _buttonlight_off(void); diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c index 77f5286da6..9864cf1f99 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c +++ b/firmware/target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c @@ -63,8 +63,6 @@ enum buttonlight_states BUTTONLIGHT_CONTROL_FADE, } buttonlight_control; - -static unsigned char backlight_brightness; static unsigned char buttonlight_brightness; static unsigned char backlight_target; static unsigned char buttonlight_target; @@ -74,11 +72,6 @@ static unsigned short buttonlight_trigger_now; /* Assumes that the backlight has been initialized */ void _backlight_set_brightness(int brightness) { - /* clamp the brightness value */ - brightness = MAX(1, MIN(12, brightness)); - /* stop the interrupt from messing us up */ - backlight_control = BACKLIGHT_CONTROL_IDLE; - backlight_brightness = log_brightness[brightness - 1]; backlight_control = BACKLIGHT_CONTROL_SET; } @@ -160,7 +153,7 @@ static void led_control_service(void) if(!(sc606regCONFval&0x03)) break; sc606_changed=true; - sc606regAval=backlight_brightness; + sc606regAval=log_brightness[backlight_brightness - 1]; backlight_control = BACKLIGHT_CONTROL_IDLE; break; case BACKLIGHT_CONTROL_FADE: |