diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-04-26 02:27:11 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-04-26 02:27:11 +0000 |
commit | 0a5beba8234eafc98d1019addc921bddb26175df (patch) | |
tree | 4bf071b8c0ccf5850b879d3bd6d8f25ed5d805c0 | |
parent | 179ac1039b2461c8140bc68d97238b44c87298fc (diff) | |
download | rockbox-0a5beba8234eafc98d1019addc921bddb26175df.tar.gz rockbox-0a5beba8234eafc98d1019addc921bddb26175df.zip |
Move the sim stubs into a seperate file to clean backlight.c up a bit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20796 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/backlight.c | 44 | ||||
-rw-r--r-- | uisimulator/common/backlight-sim.h | 68 |
2 files changed, 70 insertions, 42 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c index 98baaec3ca..375da655f7 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c | |||
@@ -42,54 +42,14 @@ | |||
42 | #endif | 42 | #endif |
43 | #ifndef SIMULATOR | 43 | #ifndef SIMULATOR |
44 | #include "backlight-target.h" | 44 | #include "backlight-target.h" |
45 | #else | ||
46 | #include "backlight-sim.h" | ||
45 | #endif | 47 | #endif |
46 | 48 | ||
47 | #if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_SETTING) \ | 49 | #if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_SETTING) \ |
48 | || (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_HW_REG) | 50 | || (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_HW_REG) |
49 | #include "backlight-sw-fading.h" | 51 | #include "backlight-sw-fading.h" |
50 | #endif | 52 | #endif |
51 | #ifdef SIMULATOR | ||
52 | |||
53 | static inline void _backlight_on(void) | ||
54 | { | ||
55 | sim_backlight(100); | ||
56 | } | ||
57 | |||
58 | static inline void _backlight_off(void) | ||
59 | { | ||
60 | sim_backlight(0); | ||
61 | } | ||
62 | |||
63 | static inline void _backlight_set_brightness(int val) | ||
64 | { | ||
65 | (void)val; | ||
66 | } | ||
67 | |||
68 | static inline void _buttonlight_on(void) | ||
69 | { | ||
70 | } | ||
71 | |||
72 | static inline void _buttonlight_off(void) | ||
73 | { | ||
74 | } | ||
75 | |||
76 | static inline void _buttonlight_set_brightness(int val) | ||
77 | { | ||
78 | (void)val; | ||
79 | } | ||
80 | #ifdef HAVE_REMOTE_LCD | ||
81 | static inline void _remote_backlight_on(void) | ||
82 | { | ||
83 | sim_remote_backlight(100); | ||
84 | } | ||
85 | |||
86 | static inline void _remote_backlight_off(void) | ||
87 | { | ||
88 | sim_remote_backlight(0); | ||
89 | } | ||
90 | #endif /* HAVE_REMOTE_LCD */ | ||
91 | |||
92 | #endif /* SIMULATOR */ | ||
93 | 53 | ||
94 | #if defined(HAVE_BACKLIGHT) && defined(BACKLIGHT_FULL_INIT) | 54 | #if defined(HAVE_BACKLIGHT) && defined(BACKLIGHT_FULL_INIT) |
95 | 55 | ||
diff --git a/uisimulator/common/backlight-sim.h b/uisimulator/common/backlight-sim.h new file mode 100644 index 0000000000..640fc1ac17 --- /dev/null +++ b/uisimulator/common/backlight-sim.h | |||
@@ -0,0 +1,68 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id:$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Linus Nielsen Feltzing | ||
11 | * Copyright (C) 2009 by Thomas Martitz | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or | ||
14 | * modify it under the terms of the GNU General Public License | ||
15 | * as published by the Free Software Foundation; either version 2 | ||
16 | * of the License, or (at your option) any later version. | ||
17 | * | ||
18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
19 | * KIND, either express or implied. | ||
20 | * | ||
21 | ****************************************************************************/ | ||
22 | #ifdef SIMULATOR | ||
23 | |||
24 | static inline void _backlight_on(void) | ||
25 | { | ||
26 | sim_backlight(100); | ||
27 | } | ||
28 | |||
29 | static inline void _backlight_off(void) | ||
30 | { | ||
31 | sim_backlight(0); | ||
32 | } | ||
33 | #ifdef HAVE_BACKLIGHT_BRIGHTNESS | ||
34 | static inline void _backlight_set_brightness(int val) | ||
35 | { | ||
36 | (void)val; | ||
37 | } | ||
38 | #endif /* HAVE_BACKLIGHT_BRIGHTNESS */ | ||
39 | #ifdef HAVE_BUTTON_LIGHT | ||
40 | static inline void _buttonlight_on(void) | ||
41 | { | ||
42 | } | ||
43 | |||
44 | static inline void _buttonlight_off(void) | ||
45 | { | ||
46 | } | ||
47 | |||
48 | #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS | ||
49 | static inline void _buttonlight_set_brightness(int val) | ||
50 | { | ||
51 | (void)val; | ||
52 | } | ||
53 | #endif /* HAVE_BUTTONLIGHT_BRIGHTNESS */ | ||
54 | #endif /* HAVE_BUTTON_LIGHT */ | ||
55 | |||
56 | #ifdef HAVE_REMOTE_LCD | ||
57 | static inline void _remote_backlight_on(void) | ||
58 | { | ||
59 | sim_remote_backlight(100); | ||
60 | } | ||
61 | |||
62 | static inline void _remote_backlight_off(void) | ||
63 | { | ||
64 | sim_remote_backlight(0); | ||
65 | } | ||
66 | #endif /* HAVE_REMOTE_LCD */ | ||
67 | |||
68 | #endif /* SIMULATOR */ | ||