summaryrefslogtreecommitdiffstats
path: root/firmware/export/backlight-sw-fading.h
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-03-11 21:10:17 +0000
committerThomas Martitz <kugel@rockbox.org>2009-03-11 21:10:17 +0000
commit924556c0a79bc15bbcbb3a2353ca6f70aed1b918 (patch)
tree553550b9df6c412c3d09a0c13e2f469b83af3d72 /firmware/export/backlight-sw-fading.h
parent105fe0679d10b73d2b4be90fe996fea41c8a6f28 (diff)
downloadrockbox-924556c0a79bc15bbcbb3a2353ca6f70aed1b918.tar.gz
rockbox-924556c0a79bc15bbcbb3a2353ca6f70aed1b918.tar.bz2
rockbox-924556c0a79bc15bbcbb3a2353ca6f70aed1b918.zip
Get rid of the last "backlight thread fading" remnant, and of the calculation of the delay. It actually wasn't more than those 3 cases before anyway.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20295 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/backlight-sw-fading.h')
-rw-r--r--firmware/export/backlight-sw-fading.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/firmware/export/backlight-sw-fading.h b/firmware/export/backlight-sw-fading.h
index 8527fd0f99..7a0dedaf46 100644
--- a/firmware/export/backlight-sw-fading.h
+++ b/firmware/export/backlight-sw-fading.h
@@ -19,13 +19,19 @@
*
****************************************************************************/
-#ifndef BACKLIGHT_THREAD_FADING_H
-#define BACKLIGHT_THREAD_FADING_H
+#ifndef BACKLIGHT_SW_FADING_H
+#define BACKLIGHT_SW_FADING_H
+
+
+/* total fading time will be current brightness level * FADE_DELAY * 10ms */
+#if (MAX_BRIGHTNESS_SETTING >= 25)
+#define FADE_DELAY 2 /* =HZ/50 => 20ms */
+#elif (MAX_BRIGHTNESS_SETTING >= 16)
+#define FADE_DELAY 3 /* =HZ/33 => 30ms */
+#else
+#define FADE_DELAY 4 /* =HZ/25 => 40ms*/
+#endif
-/* 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)
-#define FADE_DELAY (HZ/(MIN(_FADE_DELAY, 40)))
void _backlight_fade_update_state(int brightness);
bool _backlight_fade_step(int direction);
@@ -38,4 +44,4 @@ enum {
FADING_DOWN,
};
-#endif /* _BACKLIGHT_THREAD_FADING_ */
+#endif /* BACKLIGHT_SW_FADING_H */