diff options
Diffstat (limited to 'firmware/export/backlight-thread-fading.h')
-rw-r--r-- | firmware/export/backlight-thread-fading.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/firmware/export/backlight-thread-fading.h b/firmware/export/backlight-thread-fading.h new file mode 100644 index 0000000000..ca9c195480 --- /dev/null +++ b/firmware/export/backlight-thread-fading.h | |||
@@ -0,0 +1,46 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id:$ | ||
9 | * | ||
10 | * Copyright (C) 2007 by Will Robertson | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #ifndef BACKLIGHT_THREAD_FADING_H | ||
23 | #define BACKLIGHT_THREAD_FADING_H | ||
24 | |||
25 | #include "config.h" | ||
26 | |||
27 | #ifdef USE_BACKLIGHT_SW_FADING | ||
28 | |||
29 | /* delay supposed to be MAX_BRIGHTNESS_SETTING*2 rounded to the next multiple | ||
30 | * of 5, however not more than 40 */ | ||
31 | #define _FADE_DELAY (((MAX_BRIGHTNESS_SETTING*2+4)/5)*5) | ||
32 | #define FADE_DELAY (HZ/(MIN(_FADE_DELAY, 40))) | ||
33 | |||
34 | void _backlight_fade_update_state(int brightness); | ||
35 | bool _backlight_fade_step(int direction); | ||
36 | |||
37 | /* enum used for both, fading state and fading type selected through the settings */ | ||
38 | |||
39 | enum { | ||
40 | NOT_FADING = 0, | ||
41 | FADING_UP, | ||
42 | FADING_DOWN, | ||
43 | }; | ||
44 | #endif /* USE_BACKLIGHT_SW_FADING */ | ||
45 | |||
46 | #endif /* _BACKLIGHT_THREAD_FADING_ */ | ||