Pass plugin api pointer to funtion directly, fixes crashes when doing incremental...
[kugel-rb.git] / apps / plugins / lib / helper.c
blob65108cec8f3b2eb53572897f54afc32f105673ce
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"
23 * force the backlight on
24 * now enabled regardless of HAVE_BACKLIGHT because it is not needed to
25 * build and makes modded targets easier to update
27 void backlight_force_on(struct plugin_api* rb)
29 if(!rb) return;
30 /* #ifdef HAVE_BACKLIGHT */
31 if (rb->global_settings->backlight_timeout > 1)
32 rb->backlight_set_timeout(1);
33 #if CONFIG_CHARGING
34 if (rb->global_settings->backlight_timeout_plugged > 1)
35 rb->backlight_set_timeout_plugged(1);
36 #endif /* CONFIG_CHARGING */
37 /* #endif */ /* HAVE_BACKLIGHT */
41 * reset backlight operation to its settings
42 * now enabled regardless of HAVE_BACKLIGHT because it is not needed to
43 * build and makes modded targets easier to update
45 void backlight_use_settings(struct plugin_api* rb)
47 if(!rb) return;
48 /* #ifdef HAVE_BACKLIGHT */
49 rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
50 #if CONFIG_CHARGING
51 rb->backlight_set_timeout_plugged(rb->global_settings-> \
52 backlight_timeout_plugged);
53 #endif /* CONFIG_CHARGING */
54 /* #endif */ /* HAVE_BACKLIGHT */