diff options
author | Steve Bavin <pondlife@pondlife.me> | 2008-11-26 10:21:03 +0000 |
---|---|---|
committer | Steve Bavin <pondlife@pondlife.me> | 2008-11-26 10:21:03 +0000 |
commit | b70f57502370b5d91e557e61ec23de95d8e027a9 (patch) | |
tree | 52dace1509fc7e547c0d6da27def523ac4e3a06e /firmware | |
parent | 28f06901f74d8574ea0de00a143cbda08326d9f7 (diff) | |
download | rockbox-b70f57502370b5d91e557e61ec23de95d8e027a9.tar.gz rockbox-b70f57502370b5d91e557e61ec23de95d8e027a9.zip |
Fix reds. Also note my r19221 commit message had a typo - shoudld have been e200/c200, not e100.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19224 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-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 @@ | |||
48 | #define BACKLIGHT_FULL_INIT | 48 | #define BACKLIGHT_FULL_INIT |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | #ifdef HAVE_BACKLIGHT_BRIGHTNESS | ||
52 | int backlight_brightness = DEFAULT_BRIGHTNESS_SETTING; | ||
53 | #endif | ||
54 | |||
51 | #ifdef USE_BACKLIGHT_SW_FADING | 55 | #ifdef USE_BACKLIGHT_SW_FADING |
52 | #include "backlight-thread-fading.h" | 56 | #include "backlight-thread-fading.h" |
53 | #endif | 57 | #endif |
@@ -139,10 +143,6 @@ static int backlight_timeout_plugged = 5*HZ; | |||
139 | static int backlight_on_button_hold = 0; | 143 | static int backlight_on_button_hold = 0; |
140 | #endif | 144 | #endif |
141 | 145 | ||
142 | #ifdef HAVE_BACKLIGHT_BRIGHTNESS | ||
143 | int backlight_brightness = DEFAULT_BRIGHTNESS_SETTING; | ||
144 | #endif | ||
145 | |||
146 | #ifdef HAVE_BUTTON_LIGHT | 146 | #ifdef HAVE_BUTTON_LIGHT |
147 | static int buttonlight_timer; | 147 | static int buttonlight_timer; |
148 | int _buttonlight_timeout = 5*HZ; | 148 | int _buttonlight_timeout = 5*HZ; |
@@ -928,8 +928,8 @@ void backlight_set_brightness(int val) | |||
928 | else if (val > MAX_BRIGHTNESS_SETTING) | 928 | else if (val > MAX_BRIGHTNESS_SETTING) |
929 | val = MAX_BRIGHTNESS_SETTING; | 929 | val = MAX_BRIGHTNESS_SETTING; |
930 | 930 | ||
931 | _backlight_set_brightness(val); | ||
932 | backlight_brightness = val; | 931 | backlight_brightness = val; |
932 | _backlight_set_brightness(val); | ||
933 | #ifdef USE_BACKLIGHT_SW_FADING | 933 | #ifdef USE_BACKLIGHT_SW_FADING |
934 | /* receive backlight brightness */ | 934 | /* receive backlight brightness */ |
935 | _backlight_fade_update_state(val); | 935 | _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); | |||
43 | void backlight_set_fade_out(bool value); | 43 | void backlight_set_fade_out(bool value); |
44 | #endif | 44 | #endif |
45 | 45 | ||
46 | extern int backlight_brightness; | ||
47 | |||
48 | void backlight_set_timeout_plugged(int value); | 46 | void backlight_set_timeout_plugged(int value); |
49 | 47 | ||
50 | #ifdef HAS_BUTTON_HOLD | 48 | #ifdef HAS_BUTTON_HOLD |
@@ -82,6 +80,7 @@ void sim_remote_backlight(int value); | |||
82 | #endif | 80 | #endif |
83 | 81 | ||
84 | #ifdef HAVE_BACKLIGHT_BRIGHTNESS | 82 | #ifdef HAVE_BACKLIGHT_BRIGHTNESS |
83 | extern int backlight_brightness; | ||
85 | void backlight_set_brightness(int val); | 84 | void backlight_set_brightness(int val); |
86 | #endif /* HAVE_BACKLIGHT_BRIGHTNESS */ | 85 | #endif /* HAVE_BACKLIGHT_BRIGHTNESS */ |
87 | 86 | ||
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 @@ | |||
134 | 134 | ||
135 | /* define this if the backlight thread is used for fade, not for sim, needs | 135 | /* define this if the backlight thread is used for fade, not for sim, needs |
136 | * HAVE_BACKLIGHT_BRIGHTNESS */ | 136 | * HAVE_BACKLIGHT_BRIGHTNESS */ |
137 | #ifndef BOOTLOADER | ||
137 | #define USE_BACKLIGHT_SW_FADING | 138 | #define USE_BACKLIGHT_SW_FADING |
139 | #endif | ||
138 | 140 | ||
139 | /* Define this if you have a PortalPlayer PP5024 */ | 141 | /* Define this if you have a PortalPlayer PP5024 */ |
140 | #define CONFIG_CPU PP5022 | 142 | #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 @@ | |||
124 | 124 | ||
125 | /* define this if the backlight thread is used for fade, not for sim, needs | 125 | /* define this if the backlight thread is used for fade, not for sim, needs |
126 | * HAVE_BACKLIGHT_BRIGHTNESS */ | 126 | * HAVE_BACKLIGHT_BRIGHTNESS */ |
127 | #ifndef BOOTLOADER | ||
127 | #define USE_BACKLIGHT_SW_FADING | 128 | #define USE_BACKLIGHT_SW_FADING |
129 | #endif | ||
128 | 130 | ||
129 | /* Define this if you have a TCC7801 */ | 131 | /* Define this if you have a TCC7801 */ |
130 | #define CONFIG_CPU TCC7801 | 132 | #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 @@ | |||
131 | 131 | ||
132 | /* define this if the backlight thread is used for fade, not for sim, needs | 132 | /* define this if the backlight thread is used for fade, not for sim, needs |
133 | * HAVE_BACKLIGHT_BRIGHTNESS */ | 133 | * HAVE_BACKLIGHT_BRIGHTNESS */ |
134 | #ifndef BOOTLOADER | ||
134 | #define USE_BACKLIGHT_SW_FADING | 135 | #define USE_BACKLIGHT_SW_FADING |
136 | #endif | ||
135 | 137 | ||
136 | /* Define this if you have a PortalPlayer PP5024 */ | 138 | /* Define this if you have a PortalPlayer PP5024 */ |
137 | #define CONFIG_CPU PP5024 | 139 | #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 @@ | |||
116 | 116 | ||
117 | /* define this if the backlight thread is used for fade, not for sim, needs | 117 | /* define this if the backlight thread is used for fade, not for sim, needs |
118 | * HAVE_BACKLIGHT_BRIGHTNESS */ | 118 | * HAVE_BACKLIGHT_BRIGHTNESS */ |
119 | #ifndef BOOTLOADER | ||
119 | #define USE_BACKLIGHT_SW_FADING | 120 | #define USE_BACKLIGHT_SW_FADING |
120 | 121 | #endif | |
121 | 122 | ||
122 | /* Define this if your LCD can be enabled/disabled */ | 123 | /* Define this if your LCD can be enabled/disabled */ |
123 | #define HAVE_LCD_ENABLE | 124 | #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 @@ | |||
124 | 124 | ||
125 | #ifndef SIMULATOR | 125 | #ifndef SIMULATOR |
126 | 126 | ||
127 | /* define this if the backlight thread is used for fade, not for sim */ | 127 | /* define this if the backlight thread is used for fade, not for sim, needs |
128 | * HAVE_BACKLIGHT_BRIGHTNESS */ | ||
129 | #ifndef BOOTLOADER | ||
128 | #define USE_BACKLIGHT_SW_FADING | 130 | #define USE_BACKLIGHT_SW_FADING |
131 | #endif | ||
129 | 132 | ||
130 | /* Define this if your LCD can set contrast */ | 133 | /* Define this if your LCD can set contrast */ |
131 | #define HAVE_LCD_CONTRAST | 134 | #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 @@ | |||
26 | #include "ascodec-target.h" | 26 | #include "ascodec-target.h" |
27 | #include "as3514.h" | 27 | #include "as3514.h" |
28 | 28 | ||
29 | static unsigned short backlight_brightness = DEFAULT_BRIGHTNESS_SETTING; | ||
30 | |||
31 | void _backlight_set_brightness(int brightness) | 29 | void _backlight_set_brightness(int brightness) |
32 | { | 30 | { |
33 | backlight_brightness = brightness; | ||
34 | |||
35 | if (brightness > 0) | 31 | if (brightness > 0) |
36 | _backlight_on(); | 32 | _backlight_on(); |
37 | else | 33 | 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 @@ | |||
25 | void _backlight_on(void); | 25 | void _backlight_on(void); |
26 | void _backlight_off(void); | 26 | void _backlight_off(void); |
27 | void _backlight_set_brightness(int brightness); | 27 | void _backlight_set_brightness(int brightness); |
28 | int __backlight_is_on(void); | ||
29 | #ifdef HAVE_BUTTON_LIGHT | 28 | #ifdef HAVE_BUTTON_LIGHT |
30 | void _buttonlight_on(void); | 29 | void _buttonlight_on(void); |
31 | void _buttonlight_off(void); | 30 | 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 | |||
63 | BUTTONLIGHT_CONTROL_FADE, | 63 | BUTTONLIGHT_CONTROL_FADE, |
64 | } buttonlight_control; | 64 | } buttonlight_control; |
65 | 65 | ||
66 | |||
67 | static unsigned char backlight_brightness; | ||
68 | static unsigned char buttonlight_brightness; | 66 | static unsigned char buttonlight_brightness; |
69 | static unsigned char backlight_target; | 67 | static unsigned char backlight_target; |
70 | static unsigned char buttonlight_target; | 68 | static unsigned char buttonlight_target; |
@@ -74,11 +72,6 @@ static unsigned short buttonlight_trigger_now; | |||
74 | /* Assumes that the backlight has been initialized */ | 72 | /* Assumes that the backlight has been initialized */ |
75 | void _backlight_set_brightness(int brightness) | 73 | void _backlight_set_brightness(int brightness) |
76 | { | 74 | { |
77 | /* clamp the brightness value */ | ||
78 | brightness = MAX(1, MIN(12, brightness)); | ||
79 | /* stop the interrupt from messing us up */ | ||
80 | backlight_control = BACKLIGHT_CONTROL_IDLE; | ||
81 | backlight_brightness = log_brightness[brightness - 1]; | ||
82 | backlight_control = BACKLIGHT_CONTROL_SET; | 75 | backlight_control = BACKLIGHT_CONTROL_SET; |
83 | } | 76 | } |
84 | 77 | ||
@@ -160,7 +153,7 @@ static void led_control_service(void) | |||
160 | if(!(sc606regCONFval&0x03)) | 153 | if(!(sc606regCONFval&0x03)) |
161 | break; | 154 | break; |
162 | sc606_changed=true; | 155 | sc606_changed=true; |
163 | sc606regAval=backlight_brightness; | 156 | sc606regAval=log_brightness[backlight_brightness - 1]; |
164 | backlight_control = BACKLIGHT_CONTROL_IDLE; | 157 | backlight_control = BACKLIGHT_CONTROL_IDLE; |
165 | break; | 158 | break; |
166 | case BACKLIGHT_CONTROL_FADE: | 159 | case BACKLIGHT_CONTROL_FADE: |