it's #else not #elif (fix red)
[Rockbox.git] / apps / plugins / lib / helper.c
blob2feff14a22cdf4f8ba267b9279fbbf7f278a862f
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2007 by Peter D'Hoye
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #include "plugin.h"
22 /* Force the backlight on */
23 void backlight_force_on(struct plugin_api* rb)
25 if(!rb)
26 return;
27 if (rb->global_settings->backlight_timeout > 0)
28 rb->backlight_set_timeout(0);
29 #if CONFIG_CHARGING
30 if (rb->global_settings->backlight_timeout_plugged > 0)
31 rb->backlight_set_timeout_plugged(0);
32 #endif /* CONFIG_CHARGING */
35 /* Reset backlight operation to its settings */
36 void backlight_use_settings(struct plugin_api* rb)
38 if (!rb)
39 return;
40 rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
41 #if CONFIG_CHARGING
42 rb->backlight_set_timeout_plugged(rb->global_settings->
43 backlight_timeout_plugged);
44 #endif /* CONFIG_CHARGING */
47 #ifdef HAVE_REMOTE_LCD
48 /* Force the backlight on */
49 void remote_backlight_force_on(struct plugin_api* rb)
51 if (!rb)
52 return;
53 if (rb->global_settings->remote_backlight_timeout > 0)
54 rb->remote_backlight_set_timeout(0);
55 #if CONFIG_CHARGING
56 if (rb->global_settings->remote_backlight_timeout_plugged > 0)
57 rb->remote_backlight_set_timeout_plugged(0);
58 #endif /* CONFIG_CHARGING */
61 /* Reset backlight operation to its settings */
62 void remote_backlight_use_settings(struct plugin_api* rb)
64 if (!rb)
65 return;
66 rb->remote_backlight_set_timeout(rb->global_settings->
67 remote_backlight_timeout);
68 #if CONFIG_CHARGING
69 rb->remote_backlight_set_timeout_plugged(rb->global_settings->
70 remote_backlight_timeout_plugged);
71 #endif /* CONFIG_CHARGING */
73 #endif /* HAVE_REMOTE_LCD */