From bf2a33485fc99d83ef74c261d092f6b95e040a37 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Thu, 29 Nov 2007 23:55:58 +0000 Subject: Fix some plugins not using the helper functions for the new backlight timeout handling. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15849 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/lib/helper.c | 56 +++++++++++++++++++++++++++++++---------------- apps/plugins/lib/helper.h | 4 ++++ 2 files changed, 41 insertions(+), 19 deletions(-) (limited to 'apps/plugins/lib') diff --git a/apps/plugins/lib/helper.c b/apps/plugins/lib/helper.c index 0151a36..2feff14 100644 --- a/apps/plugins/lib/helper.c +++ b/apps/plugins/lib/helper.c @@ -19,37 +19,55 @@ #include "plugin.h" -/* - * force the backlight on - * now enabled regardless of HAVE_BACKLIGHT because it is not needed to - * build and makes modded targets easier to update - */ +/* Force the backlight on */ void backlight_force_on(struct plugin_api* rb) { - if(!rb) return; -/* #ifdef HAVE_BACKLIGHT */ + if(!rb) + return; if (rb->global_settings->backlight_timeout > 0) rb->backlight_set_timeout(0); #if CONFIG_CHARGING if (rb->global_settings->backlight_timeout_plugged > 0) rb->backlight_set_timeout_plugged(0); #endif /* CONFIG_CHARGING */ -/* #endif */ /* HAVE_BACKLIGHT */ -} +} -/* - * reset backlight operation to its settings - * now enabled regardless of HAVE_BACKLIGHT because it is not needed to - * build and makes modded targets easier to update - */ +/* Reset backlight operation to its settings */ void backlight_use_settings(struct plugin_api* rb) { - if(!rb) return; -/* #ifdef HAVE_BACKLIGHT */ + if (!rb) + return; rb->backlight_set_timeout(rb->global_settings->backlight_timeout); #if CONFIG_CHARGING - rb->backlight_set_timeout_plugged(rb->global_settings-> \ - backlight_timeout_plugged); + rb->backlight_set_timeout_plugged(rb->global_settings-> + backlight_timeout_plugged); +#endif /* CONFIG_CHARGING */ +} + +#ifdef HAVE_REMOTE_LCD +/* Force the backlight on */ +void remote_backlight_force_on(struct plugin_api* rb) +{ + if (!rb) + return; + if (rb->global_settings->remote_backlight_timeout > 0) + rb->remote_backlight_set_timeout(0); +#if CONFIG_CHARGING + if (rb->global_settings->remote_backlight_timeout_plugged > 0) + rb->remote_backlight_set_timeout_plugged(0); +#endif /* CONFIG_CHARGING */ +} + +/* Reset backlight operation to its settings */ +void remote_backlight_use_settings(struct plugin_api* rb) +{ + if (!rb) + return; + rb->remote_backlight_set_timeout(rb->global_settings-> + remote_backlight_timeout); +#if CONFIG_CHARGING + rb->remote_backlight_set_timeout_plugged(rb->global_settings-> + remote_backlight_timeout_plugged); #endif /* CONFIG_CHARGING */ -/* #endif */ /* HAVE_BACKLIGHT */ } +#endif /* HAVE_REMOTE_LCD */ diff --git a/apps/plugins/lib/helper.h b/apps/plugins/lib/helper.h index f2f5f87..744ad4d 100644 --- a/apps/plugins/lib/helper.h +++ b/apps/plugins/lib/helper.h @@ -26,5 +26,9 @@ */ void backlight_force_on(struct plugin_api* rb); void backlight_use_settings(struct plugin_api* rb); +#ifdef HAVE_REMOTE_LCD +void remote_backlight_force_on(struct plugin_api* rb); +void remote_backlight_use_settings(struct plugin_api* rb); +#endif #endif -- cgit v1.1