summaryrefslogtreecommitdiff
path: root/apps/plugins/lib
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2007-08-13 22:31:11 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2007-08-13 22:31:11 +0000
commita5d4d67763a01f27453ae453c73e2bc4695131f9 (patch)
tree4c15a114b24ba96ec7f9096b06051c9d2f55c625 /apps/plugins/lib
parent07a09041d6ca8c84280e9f9b372e8cc0eeb8166e (diff)
downloadrockbox-a5d4d67763a01f27453ae453c73e2bc4695131f9.zip
rockbox-a5d4d67763a01f27453ae453c73e2bc4695131f9.tar.gz
rockbox-a5d4d67763a01f27453ae453c73e2bc4695131f9.tar.bz2
rockbox-a5d4d67763a01f27453ae453c73e2bc4695131f9.tar.xz
Also keep the backlight on in mpegplayer when plugged in. Fixes FS #7584. Created two helper functions for this, because this issue also exists in other plugins (to do). The helper functions are in the pluginlib in helper.[ch], where other common stuff can be put.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14321 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lib')
-rw-r--r--apps/plugins/lib/SOURCES1
-rw-r--r--apps/plugins/lib/helper.c46
-rw-r--r--apps/plugins/lib/helper.h30
3 files changed, 77 insertions, 0 deletions
diff --git a/apps/plugins/lib/SOURCES b/apps/plugins/lib/SOURCES
index 88d362a..f671184 100644
--- a/apps/plugins/lib/SOURCES
+++ b/apps/plugins/lib/SOURCES
@@ -30,3 +30,4 @@ bmp.c
#endif
#endif
pluginlib_actions.c
+helper.c
diff --git a/apps/plugins/lib/helper.c b/apps/plugins/lib/helper.c
new file mode 100644
index 0000000..cf1877d
--- /dev/null
+++ b/apps/plugins/lib/helper.c
@@ -0,0 +1,46 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id: helper.c 12179 2007-08-14 23:08:15Z peter $
+ *
+ * Copyright (C) 2007 by Peter D'Hoye
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+#include "plugin.h"
+
+/* the plugin must declare the plugin_api struct pointer itself */
+extern struct plugin_api* rb;
+
+/* force the backlight on */
+void backlight_force_on(void)
+{
+#ifdef HAVE_BACKLIGHT
+ rb->backlight_set_timeout(1);
+#if CONFIG_CHARGING
+ rb->backlight_set_timeout_plugged(1);
+#endif
+#endif
+}
+
+/* reset backlight operation to its settings */
+void backlight_use_settings(void)
+{
+#ifdef HAVE_BACKLIGHT
+ rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
+#if CONFIG_CHARGING
+ rb->backlight_set_timeout_plugged(rb->global_settings-> \
+ backlight_timeout_plugged);
+#endif
+#endif
+}
diff --git a/apps/plugins/lib/helper.h b/apps/plugins/lib/helper.h
new file mode 100644
index 0000000..abeac59
--- /dev/null
+++ b/apps/plugins/lib/helper.h
@@ -0,0 +1,30 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id: helper.h 10254 2007-08-14 19:44:44Z peter $
+ *
+ * Copyright (C) 2007 by Peter D'Hoye
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+#ifndef _LIB_HELPER_H_
+#define _LIB_HELPER_H_
+
+#include "plugin.h"
+
+/**
+ * Backlight on/off operations
+ */
+void backlight_force_on(void);
+void backlight_use_settings(void);
+
+#endif