Index: apps/settings.c =================================================================== --- apps/settings.c (Revision 19818) +++ apps/settings.c (Arbeitskopie) @@ -773,9 +773,8 @@ #if CONFIG_CHARGING backlight_set_timeout_plugged(global_settings.backlight_timeout_plugged); #endif -#if (defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)) \ - || defined(USE_BACKLIGHT_SW_FADING) \ - || defined(USE_BACKLIGHT_CUSTOM_FADING_BOOL) +#if defined(HAVE_BACKLIGHT_FADING_INT_SETTING) \ + || defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING) backlight_set_fade_in(global_settings.backlight_fade_in); backlight_set_fade_out(global_settings.backlight_fade_out); #endif Index: apps/settings.h =================================================================== --- apps/settings.h (Revision 19818) +++ apps/settings.h (Arbeitskopie) @@ -681,11 +681,10 @@ int lcd_sleep_after_backlight_off; /* when to put lcd to sleep after backlight has turned off */ #endif -#if defined(HAVE_BACKLIGHT_PWM_FADING) +#if defined(HAVE_BACKLIGHT_FADING_INT_SETTING) int backlight_fade_in; /* backlight fade in timing: 0..3 */ int backlight_fade_out; /* backlight fade in timing: 0..7 */ -#elif defined(USE_BACKLIGHT_SW_FADING) \ - || defined(USE_BACKLIGHT_CUSTOM_FADING_BOOL) +#elif defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING) bool backlight_fade_in; bool backlight_fade_out; #endif Index: apps/menus/display_menu.c =================================================================== --- apps/menus/display_menu.c (Revision 19818) +++ apps/menus/display_menu.c (Arbeitskopie) @@ -91,9 +91,8 @@ &global_settings.backlight_on_button_hold, NULL); #endif MENUITEM_SETTING(caption_backlight, &global_settings.caption_backlight, NULL); -#if (defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)) || \ - defined(USE_BACKLIGHT_SW_FADING) || \ - defined(USE_BACKLIGHT_CUSTOM_FADING_BOOL) +#if defined(HAVE_BACKLIGHT_FADING_INT_SETTING) \ + || defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING) MENUITEM_SETTING(backlight_fade_in, &global_settings.backlight_fade_in, NULL); MENUITEM_SETTING(backlight_fade_out, &global_settings.backlight_fade_out, NULL); #endif @@ -132,9 +131,8 @@ ,&backlight_on_button_hold # endif ,&caption_backlight -#if (defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)) || \ - defined(USE_BACKLIGHT_SW_FADING) || \ - defined(USE_BACKLIGHT_CUSTOM_FADING_BOOL) +#if defined(HAVE_BACKLIGHT_FADING_INT_SETTING) \ + || defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING) ,&backlight_fade_in, &backlight_fade_out #endif ,&bl_filter_first_keypress Index: apps/settings_list.c =================================================================== --- apps/settings_list.c (Revision 19818) +++ apps/settings_list.c (Arbeitskopie) @@ -671,15 +671,14 @@ OFFON_SETTING(0, remote_caption_backlight, LANG_CAPTION_BACKLIGHT, false, "remote caption backlight", NULL), #endif -#endif /* HAVE_BACKLIGHT */ #ifdef HAVE_BACKLIGHT_BRIGHTNESS INT_SETTING(F_NO_WRAP, brightness, LANG_BRIGHTNESS, DEFAULT_BRIGHTNESS_SETTING, "brightness",UNIT_INT, MIN_BRIGHTNESS_SETTING, MAX_BRIGHTNESS_SETTING, 1, NULL, NULL, backlight_set_brightness), #endif -#if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR) /* backlight fading */ +#if defined(HAVE_BACKLIGHT_FADING_INT_SETTING) TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, backlight_fade_in, LANG_BACKLIGHT_FADE_IN, 300, "backlight fade in", "off", UNIT_MS, formatter_unit_0_is_off, getlang_unit_0_is_off, @@ -689,13 +688,13 @@ UNIT_MS, formatter_unit_0_is_off, getlang_unit_0_is_off, backlight_set_fade_out, 10, 0,100,200,300,500,1000,2000,3000,5000,10000), -#elif defined(USE_BACKLIGHT_SW_FADING) \ - || defined(USE_BACKLIGHT_CUSTOM_FADING_BOOL) +#elif defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING) OFFON_SETTING(0, backlight_fade_in, LANG_BACKLIGHT_FADE_IN, true, "backlight fade in", backlight_set_fade_in), OFFON_SETTING(0, backlight_fade_out, LANG_BACKLIGHT_FADE_OUT, true, "backlight fade out", backlight_set_fade_out), #endif +#endif /* HAVE_BACKLIGHT */ INT_SETTING(F_PADTITLE, scroll_speed, LANG_SCROLL_SPEED, 9,"scroll speed", UNIT_INT, 0, 15, 1, NULL, NULL, lcd_scroll_speed), INT_SETTING(F_PADTITLE, scroll_delay, LANG_SCROLL_DELAY, 1000, Index: apps/features.txt =================================================================== --- apps/features.txt (Revision 19818) +++ apps/features.txt (Arbeitskopie) @@ -20,12 +20,10 @@ backlight_brightness #endif -#if defined(HAVE_BACKLIGHT_PWM_FADING) -backlight_fade_pwm -#elif defined(USE_BACKLIGHT_SW_FADING) -backlight_fade_sw -#elif defined(USE_BACKLIGHT_CUSTOM_FADING_BOOL) -backlight_fade_custom_bool +#if defined(HAVE_BACKLIGHT_FADING_INT_SETTING) +backlight_fade_int +#elif defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING) +backlight_fade_bool #endif #if BATTERY_TYPES_COUNT > 1 Index: firmware/export/config-c200.h =================================================================== --- firmware/export/config-c200.h (Revision 19818) +++ firmware/export/config-c200.h (Arbeitskopie) @@ -111,6 +111,14 @@ #define HAVE_BACKLIGHT #define HAVE_BACKLIGHT_BRIGHTNESS +/* Main LCD backlight brightness range and defaults */ +#define MIN_BRIGHTNESS_SETTING 1 +#define MAX_BRIGHTNESS_SETTING 12 +#define DEFAULT_BRIGHTNESS_SETTING 6 + +/* Which backlight fading type? */ +#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING + /* define this if you have a flash memory storage */ #define HAVE_FLASH_STORAGE @@ -138,12 +146,6 @@ /** 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 a PortalPlayer PP5024 */ #define CONFIG_CPU PP5022 @@ -203,13 +205,6 @@ #endif /* SIMULATOR */ -/** Port-specific settings **/ - -/* Main LCD backlight brightness range and defaults */ -#define MIN_BRIGHTNESS_SETTING 1 -#define MAX_BRIGHTNESS_SETTING 12 -#define DEFAULT_BRIGHTNESS_SETTING 6 - /* Default recording levels */ #define DEFAULT_REC_MIC_GAIN 23 #define DEFAULT_REC_LEFT_GAIN 23 Index: firmware/export/config-fuze.h =================================================================== --- firmware/export/config-fuze.h (Revision 19818) +++ firmware/export/config-fuze.h (Arbeitskopie) @@ -106,6 +106,14 @@ #define HAVE_BACKLIGHT #define HAVE_BACKLIGHT_BRIGHTNESS +/* Main LCD backlight brightness range and defaults */ +#define MIN_BRIGHTNESS_SETTING 1 +#define MAX_BRIGHTNESS_SETTING 12 +#define DEFAULT_BRIGHTNESS_SETTING 6 + +/* Which backlight fading type? */ +#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING + /* define this if the unit uses a scrollwheel for navigation */ #define HAVE_SCROLLWHEEL /* define from which rotation speed [degree/sec] on the acceleration starts */ @@ -134,12 +142,6 @@ /** 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 @@ -195,13 +197,6 @@ #endif /* SIMULATOR */ -/** Port-specific settings **/ - -/* Main LCD backlight brightness range and defaults */ -#define MIN_BRIGHTNESS_SETTING 1 -#define MAX_BRIGHTNESS_SETTING 12 -#define DEFAULT_BRIGHTNESS_SETTING 6 - /* Default recording levels */ #define DEFAULT_REC_MIC_GAIN 23 #define DEFAULT_REC_LEFT_GAIN 23 Index: firmware/export/config-e200v2.h =================================================================== --- firmware/export/config-e200v2.h (Revision 19818) +++ firmware/export/config-e200v2.h (Arbeitskopie) @@ -106,6 +106,14 @@ #define HAVE_BACKLIGHT #define HAVE_BACKLIGHT_BRIGHTNESS +/* Main LCD backlight brightness range and defaults */ +#define MIN_BRIGHTNESS_SETTING 1 +#define MAX_BRIGHTNESS_SETTING 12 +#define DEFAULT_BRIGHTNESS_SETTING 6 + +/* Which backlight fading type? */ +#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING + /* define this if the unit uses a scrollwheel for navigation */ #define HAVE_SCROLLWHEEL /* define from which rotation speed [degree/sec] on the acceleration starts */ @@ -134,12 +142,6 @@ /** 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 @@ -195,13 +197,6 @@ #endif /* SIMULATOR */ -/** Port-specific settings **/ - -/* Main LCD backlight brightness range and defaults */ -#define MIN_BRIGHTNESS_SETTING 1 -#define MAX_BRIGHTNESS_SETTING 12 -#define DEFAULT_BRIGHTNESS_SETTING 6 - /* Default recording levels */ #define DEFAULT_REC_MIC_GAIN 23 #define DEFAULT_REC_LEFT_GAIN 23 Index: firmware/export/config-mrobe100.h =================================================================== --- firmware/export/config-mrobe100.h (Revision 19818) +++ firmware/export/config-mrobe100.h (Arbeitskopie) @@ -70,7 +70,7 @@ #define HAVE_BACKLIGHT /* We can fade the backlight by using PWM */ -#define HAVE_BACKLIGHT_PWM_FADING +#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_PWM /* Main LCD backlight brightness range and defaults */ #define MIN_BRIGHTNESS_SETTING 1 Index: firmware/export/config-e200.h =================================================================== --- firmware/export/config-e200.h (Revision 19818) +++ firmware/export/config-e200.h (Arbeitskopie) @@ -101,6 +101,9 @@ #define HAVE_BACKLIGHT #define HAVE_BACKLIGHT_BRIGHTNESS +/* Which backlight fading type? */ +#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING + /* define this if the unit uses a scrollwheel for navigation */ #define HAVE_SCROLLWHEEL /* define from which rotation speed [degree/sec] on the acceleration starts */ @@ -135,12 +138,6 @@ /** 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 a PortalPlayer PP5024 */ #define CONFIG_CPU PP5024 Index: firmware/export/config-ipodvideo.h =================================================================== --- firmware/export/config-ipodvideo.h (Revision 19818) +++ firmware/export/config-ipodvideo.h (Arbeitskopie) @@ -86,13 +86,14 @@ #define HAVE_BACKLIGHT #define HAVE_BACKLIGHT_BRIGHTNESS +/* We can fade the backlight by using PWM */ +#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_PWM + /* Main LCD backlight brightness range and defaults */ #define MIN_BRIGHTNESS_SETTING 1 #define MAX_BRIGHTNESS_SETTING 32 #define DEFAULT_BRIGHTNESS_SETTING 16 -/* We can fade the backlight by using PWM */ -#define HAVE_BACKLIGHT_PWM_FADING /* define this if the unit uses a scrollwheel for navigation */ #define HAVE_SCROLLWHEEL Index: firmware/export/backlight.h =================================================================== --- firmware/export/backlight.h (Revision 19818) +++ firmware/export/backlight.h (Arbeitskopie) @@ -34,12 +34,10 @@ int backlight_get_current_timeout(void); -#if defined(HAVE_BACKLIGHT_PWM_FADING) +#if defined(HAVE_BACKLIGHT_FADING_INT_SETTING) void backlight_set_fade_in(int value); void backlight_set_fade_out(int value); -#endif -#if defined(USE_BACKLIGHT_SW_FADING) \ - || defined(USE_BACKLIGHT_CUSTOM_FADING_BOOL) +#elif defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING) void backlight_set_fade_in(bool value); void backlight_set_fade_out(bool value); #endif Index: firmware/export/config-ipodmini.h =================================================================== --- firmware/export/config-ipodmini.h (Revision 19818) +++ firmware/export/config-ipodmini.h (Arbeitskopie) @@ -101,7 +101,7 @@ #define HAVE_BACKLIGHT /* We can fade the backlight by using PWM */ -#define HAVE_BACKLIGHT_PWM_FADING +#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_PWM /* Define this if you can detect headphones */ #define HAVE_HEADPHONE_DETECTION Index: firmware/export/config-h120.h =================================================================== --- firmware/export/config-h120.h (Revision 19818) +++ firmware/export/config-h120.h (Arbeitskopie) @@ -69,7 +69,7 @@ #define HAVE_BACKLIGHT /* We can fade the backlight by using PWM */ -#define HAVE_BACKLIGHT_PWM_FADING +#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_PWM /* Define this if you have a software controlled poweroff */ #define HAVE_SW_POWEROFF Index: firmware/export/config-c200v2.h =================================================================== --- firmware/export/config-c200v2.h (Revision 19818) +++ firmware/export/config-c200v2.h (Arbeitskopie) @@ -136,12 +136,6 @@ /** 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 a PortalPlayer PP5024 */ #define CONFIG_CPU AS3525 Index: firmware/export/config-ipodmini2g.h =================================================================== --- firmware/export/config-ipodmini2g.h (Revision 19818) +++ firmware/export/config-ipodmini2g.h (Arbeitskopie) @@ -101,7 +101,7 @@ #define HAVE_BACKLIGHT /* We can fade the backlight by using PWM */ -#define HAVE_BACKLIGHT_PWM_FADING +#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_PWM /* define this if the unit uses a scrollwheel for navigation */ #define HAVE_SCROLLWHEEL Index: firmware/export/config.h =================================================================== --- firmware/export/config.h (Revision 19818) +++ firmware/export/config.h (Arbeitskopie) @@ -113,6 +113,24 @@ #define H300_REMOTE 2 #define X5_REMOTE 3 +/* CONFIG_BACKLIGHT_FADING */ +/* No fading capabilities at all (yet) */ +#define BACKLIGHT_NO_FADING 0x0 +/* Backlight fading is controlled using a hardware PWM mechanism */ +#define BACKLIGHT_FADING_PWM 0x1 +/* Backlight is controlled using a software implementation + * BACKLIGHT_FADING_SW_SETTING means that backlight is turned on by only setting + * the brightness (i.e. no real difference between backlight_on and + * backlight_set_brightness) + * BACKLIGHT_FADING_SW_SETTING means that backlight brightness is restored + * "in hardware", from a hardware register upon backlight_on + * Both types need to have minor adjustments in the software fading code */ +#define BACKLIGHT_FADING_SW_SETTING 0x2 +#define BACKLIGHT_FADING_SW_HW_REG 0x4 +/* Backlight fading is done in a target specific way + * for example in hardware, but not controllable*/ +#define BACKLIGHT_FADING_TARGET 0x8 + /* CONFIG_CHARGING */ /* Generic types */ @@ -348,7 +366,12 @@ #include "config_caps.h" /* now set any CONFIG_ defines correctly if they are not used, - No need to do this on CONFIG_'s which are compulsary (e.g CONFIG_CODEC ) */ + No need to do this on CONFIG_'s which are compulsory (e.g CONFIG_CODEC ) */ + +#if !defined(CONFIG_BACKLIGHT_FADING) +#define CONFIG_BACKLIGHT_FADING BACKLIGHT_NO_FADING +#endif + #ifndef CONFIG_TUNER #define CONFIG_TUNER 0 #endif @@ -413,6 +436,32 @@ #define CONFIG_STORAGE_MULTI #endif +/* deactive fading in bootloader/sim */ +#if defined(BOOTLOADER) || defined(SIMULATOR) +#undef CONFIG_BACKLIGHT_FADING +#define CONFIG_BACKLIGHT_FADING BACKLIGHT_NO_FADING +#endif + +/* determine which setting/manual text to use, + * possibly overridden in target config */ +#if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_PWM) + +#ifndef HAVE_BACKLIGHT_FADING_INT_SETTING +#define HAVE_BACKLIGHT_FADING_INT_SETTING +#endif + +#elif (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_SETTING) \ + || (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_HW_REG) \ + || (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_TARGET) + +/* BACKLIGHT_FADING_TARGET may the setting to use */ +#if !defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING) \ + && !defined(HAVE_BACKLIGHT_FADING_INT_SETTING) +#define HAVE_BACKLIGHT_FADING_BOOL_SETTING +#endif + +#endif /* CONFIG_BACKLIGHT_FADING */ + #if defined(BOOTLOADER) && defined(HAVE_ADJUSTABLE_CPU_FREQ) /* Bootloaders don't use CPU frequency adjustment */ #undef HAVE_ADJUSTABLE_CPU_FREQ Index: firmware/export/config-ipodnano.h =================================================================== --- firmware/export/config-ipodnano.h (Revision 19818) +++ firmware/export/config-ipodnano.h (Arbeitskopie) @@ -81,15 +81,14 @@ /* Define this for LCD backlight available */ #define HAVE_BACKLIGHT #define HAVE_BACKLIGHT_BRIGHTNESS +/* We can fade the backlight by using PWM */ +#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_PWM /* Main LCD backlight brightness range and defaults */ #define MIN_BRIGHTNESS_SETTING 1 #define MAX_BRIGHTNESS_SETTING 32 #define DEFAULT_BRIGHTNESS_SETTING 16 -/* We can fade the backlight by using PWM */ -#define HAVE_BACKLIGHT_PWM_FADING - /* define this if the unit uses a scrollwheel for navigation */ #define HAVE_SCROLLWHEEL /* define from which rotation speed [degree/sec] on the acceleration starts */ Index: firmware/export/config-sa9200.h =================================================================== --- firmware/export/config-sa9200.h (Revision 19818) +++ firmware/export/config-sa9200.h (Arbeitskopie) @@ -90,6 +90,9 @@ #define MAX_BRIGHTNESS_SETTING 12 #define DEFAULT_BRIGHTNESS_SETTING 6 +/* Which backlight fading type? */ +#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING + /* define this if you have a flash memory storage */ #define HAVE_FLASH_STORAGE Index: firmware/export/config-h100.h =================================================================== --- firmware/export/config-h100.h (Revision 19818) +++ firmware/export/config-h100.h (Arbeitskopie) @@ -74,7 +74,7 @@ #define HAVE_BACKLIGHT /* We can fade the backlight by using PWM */ -#define HAVE_BACKLIGHT_PWM_FADING +#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_PWM /* Define this if you have a software controlled poweroff */ #define HAVE_SW_POWEROFF Index: firmware/export/config-h300.h =================================================================== --- firmware/export/config-h300.h (Revision 19818) +++ firmware/export/config-h300.h (Arbeitskopie) @@ -68,6 +68,8 @@ /* Define this for LCD backlight available */ #define HAVE_BACKLIGHT #define HAVE_BACKLIGHT_BRIGHTNESS +/* Which backlight fading type? */ +#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_HW_REG /* Define this if you have a software controlled poweroff */ #define HAVE_SW_POWEROFF @@ -125,12 +127,6 @@ #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 your LCD can be enabled/disabled */ #define HAVE_LCD_ENABLE Index: firmware/export/config-iaudiox5.h =================================================================== --- firmware/export/config-iaudiox5.h (Revision 19818) +++ firmware/export/config-iaudiox5.h (Arbeitskopie) @@ -90,6 +90,8 @@ /* Define this for LCD backlight available */ #define HAVE_BACKLIGHT #define HAVE_BACKLIGHT_BRIGHTNESS +/* Which backlight fading type? */ +#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_HW_REG /* define this if you have a disk storage, i.e. something that needs spinups and can cause skips when shaked */ @@ -127,12 +129,6 @@ #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 your LCD can set contrast */ #define HAVE_LCD_CONTRAST Index: firmware/export/backlight-sw-fading.h =================================================================== --- firmware/export/backlight-sw-fading.h (Revision 19818) +++ firmware/export/backlight-sw-fading.h (Arbeitskopie) @@ -22,10 +22,6 @@ #ifndef BACKLIGHT_THREAD_FADING_H #define BACKLIGHT_THREAD_FADING_H -#include "config.h" - -#ifdef USE_BACKLIGHT_SW_FADING - /* delay supposed to be MAX_BRIGHTNESS_SETTING*2 rounded to the next multiple * of 5, however not more than 40 */ #define _FADE_DELAY (((MAX_BRIGHTNESS_SETTING*2+4)/5)*5) @@ -41,6 +37,5 @@ FADING_UP, FADING_DOWN, }; -#endif /* USE_BACKLIGHT_SW_FADING */ #endif /* _BACKLIGHT_THREAD_FADING_ */ Index: firmware/export/config-gigabeat-s.h =================================================================== --- firmware/export/config-gigabeat-s.h (Revision 19818) +++ firmware/export/config-gigabeat-s.h (Arbeitskopie) @@ -117,15 +117,14 @@ #define MAX_BRIGHTNESS_SETTING 24 #define DEFAULT_BRIGHTNESS_SETTING 12 +/* Implementation-defined fading type with bool settings */ +#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_TARGET #define HAVE_HEADPHONE_DETECTION #endif /* BOOTLOADER */ #ifndef SIMULATOR -/* Implementation-defined fading type with bool settings */ -#define USE_BACKLIGHT_CUSTOM_FADING_BOOL - /* The LCD on a Gigabeat is 240x320 - it is portrait */ #define HAVE_PORTRAIT_LCD Index: firmware/export/config-cowond2.h =================================================================== --- firmware/export/config-cowond2.h (Revision 19818) +++ firmware/export/config-cowond2.h (Arbeitskopie) @@ -108,9 +108,10 @@ /* Define this for LCD backlight available */ #define HAVE_BACKLIGHT - /* Enable LCD brightness control */ #define HAVE_BACKLIGHT_BRIGHTNESS +/* Which backlight fading type? */ +#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_HW_REG /* Main LCD backlight brightness range and defaults */ #define MIN_BRIGHTNESS_SETTING 1 @@ -129,13 +130,6 @@ #define CONFIG_CHARGING CHARGING_SIMPLE #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 a TCC7801 */ #define CONFIG_CPU TCC7801 Index: firmware/backlight-sw-fading.c =================================================================== --- firmware/backlight-sw-fading.c (Revision 19818) +++ firmware/backlight-sw-fading.c (Arbeitskopie) @@ -30,7 +30,7 @@ /* To adapt a target do: * - make sure _backlight_on doesn't set the brightness to something other than * the previous value (lowest brightness in most cases) - * - #define USE_BACKLIGHT_SW_FADING in config-.h + * add proper #defines for software fading */ /* can be MIN_BRIGHTNESS_SETTING-1 */ Index: firmware/backlight.c =================================================================== --- firmware/backlight.c (Revision 19818) +++ firmware/backlight.c (Arbeitskopie) @@ -52,7 +52,8 @@ int backlight_brightness = DEFAULT_BRIGHTNESS_SETTING; #endif -#ifdef USE_BACKLIGHT_SW_FADING +#if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_SETTING) \ + || (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_HW_REG) #include "backlight-sw-fading.h" #endif #ifdef SIMULATOR @@ -230,14 +231,15 @@ } #endif /* HAVE_LCD_SLEEP */ -#ifdef USE_BACKLIGHT_SW_FADING +#if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_SETTING) \ + || (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_HW_REG) static int backlight_fading_type = (FADING_UP|FADING_DOWN); static int backlight_fading_state = NOT_FADING; #endif -#if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR) /* backlight fading */ +#if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_PWM) #define BL_PWM_INTERVAL 5 /* Cycle interval in ms */ #define BL_PWM_BITS 8 #define BL_PWM_COUNT (1<