From ac13e52522dac375096a65264ceae00afb3c5973 Mon Sep 17 00:00:00 2001 From: Peter D'Hoye Date: Wed, 12 Jul 2006 23:15:16 +0000 Subject: jpeg viewer: keep backlight on. Patch 5652 by Matthias Mohr plus some changes by me. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10207 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/jpeg.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'apps/plugins') diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c index 5656aee7eb..890ee8e252 100644 --- a/apps/plugins/jpeg.c +++ b/apps/plugins/jpeg.c @@ -2785,12 +2785,26 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) buf_images = buf; buf_images_size = buf_size; + /* make sure the backlight is always on when viewing pictures + (actually it should also set the timeout when plugged in, + but the function backlight_set_timeout_plugged is not + available in plugins) */ +#ifdef CONFIG_BACKLIGHT + if (rb->global_settings->backlight_timeout > 0) + rb->backlight_set_timeout(1); +#endif + do { condition = load_and_show(np_file); }while (condition != PLUGIN_OK && condition != PLUGIN_USB_CONNECTED && condition != PLUGIN_ERROR); +#ifdef CONFIG_BACKLIGHT + /* reset backlight settings */ + rb->backlight_set_timeout(rb->global_settings->backlight_timeout); +#endif + #ifdef USEGSLIB gray_release(); /* deinitialize */ #endif -- cgit v1.2.3