From 01313d5039609c34b2b56ec8ba7a3a6c48ddaf3c Mon Sep 17 00:00:00 2001 From: Teruaki Kawashima Date: Mon, 24 Jan 2011 12:29:16 +0000 Subject: * Rename backlight_force_on to backlight_ignore_timeout to make it clear what the function does. * Add backlight_force_on() which forces to turn on backlight even when the setting is set to Off. use this in lamp. No functional change except lamp. See aslo FS#9883. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29128 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/brickmania.c | 4 ++-- apps/plugins/chopper.c | 4 ++-- apps/plugins/credits.c | 4 ++-- apps/plugins/demystify.c | 4 ++-- apps/plugins/doom/rockdoom.c | 2 +- apps/plugins/fft/fft.c | 2 +- apps/plugins/fire.c | 4 ++-- apps/plugins/fireworks.c | 4 ++-- apps/plugins/greyscale.c | 4 ++-- apps/plugins/imageviewer/imageviewer.c | 4 ++-- apps/plugins/invadrox.c | 4 ++-- apps/plugins/lib/helper.c | 26 +++++++++++++++++++++++++- apps/plugins/lib/helper.h | 3 +++ apps/plugins/lrcplayer.c | 6 +++--- apps/plugins/maze.c | 4 ++-- apps/plugins/mazezam.c | 4 ++-- apps/plugins/mpegplayer/mpegplayer.c | 3 +-- apps/plugins/oscilloscope.c | 4 ++-- apps/plugins/pdbox/pdbox.c | 2 +- apps/plugins/pictureflow/pictureflow.c | 4 ++-- apps/plugins/pitch_detector.c | 4 ++-- apps/plugins/plasma.c | 4 ++-- apps/plugins/pong.c | 2 +- apps/plugins/resistor.c | 6 +++--- apps/plugins/rockblox.c | 8 ++++---- apps/plugins/rockboy/menu.c | 2 +- apps/plugins/rockboy/rockboy.c | 2 +- apps/plugins/rocklife.c | 4 ++-- apps/plugins/spacerocks.c | 4 ++-- apps/plugins/starfield.c | 4 ++-- apps/plugins/test_disk.c | 4 ++-- apps/plugins/test_fps.c | 4 ++-- apps/plugins/test_gfx.c | 2 +- apps/plugins/test_grey.c | 4 ++-- apps/plugins/video.c | 4 ++-- apps/plugins/wormlet.c | 4 ++-- apps/plugins/xobox.c | 4 ++-- 37 files changed, 94 insertions(+), 68 deletions(-) (limited to 'apps/plugins') diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c index 79ebfefbd4..6295862eac 100644 --- a/apps/plugins/brickmania.c +++ b/apps/plugins/brickmania.c @@ -2427,7 +2427,7 @@ enum plugin_status plugin_start(const void* parameter) rb->lcd_set_backdrop(NULL); #endif /* Turn off backlight timeout */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); /* now go ahead and have fun! */ rb->srand( *rb->current_tick ); @@ -2458,7 +2458,7 @@ enum plugin_status plugin_start(const void* parameter) /* Restore user's original backlight setting */ rb->lcd_setfont(FONT_UI); /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); return PLUGIN_OK; } diff --git a/apps/plugins/chopper.c b/apps/plugins/chopper.c index fce7232d23..5f9fadf205 100644 --- a/apps/plugins/chopper.c +++ b/apps/plugins/chopper.c @@ -1050,7 +1050,7 @@ enum plugin_status plugin_start(const void* parameter) #endif /* Turn off backlight timeout */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); rb->srand( *rb->current_tick ); @@ -1063,7 +1063,7 @@ enum plugin_status plugin_start(const void* parameter) rb->lcd_setfont(FONT_UI); /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); return ret; } diff --git a/apps/plugins/credits.c b/apps/plugins/credits.c index 8f86c7626b..d766d45cfd 100644 --- a/apps/plugins/credits.c +++ b/apps/plugins/credits.c @@ -372,7 +372,7 @@ enum plugin_status plugin_start(const void* parameter) (void)parameter; /* Turn off backlight timeout */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); rb->show_logo(); #ifdef HAVE_LCD_CHARCELLS @@ -384,7 +384,7 @@ enum plugin_status plugin_start(const void* parameter) roll_credits(); /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); return PLUGIN_OK; } diff --git a/apps/plugins/demystify.c b/apps/plugins/demystify.c index 6b923a6ed0..e8d4d350d6 100644 --- a/apps/plugins/demystify.c +++ b/apps/plugins/demystify.c @@ -436,9 +436,9 @@ enum plugin_status plugin_start(const void* parameter) #if LCD_DEPTH > 1 rb->lcd_set_backdrop(NULL); #endif - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); #ifdef HAVE_REMOTE_LCD - remote_backlight_force_on(); /* remote backlight control in lib/helper.c */ + remote_backlight_ignore_timeout(); #endif ret = plugin_main(); diff --git a/apps/plugins/doom/rockdoom.c b/apps/plugins/doom/rockdoom.c index 4267a613c7..6ce0e6d38d 100644 --- a/apps/plugins/doom/rockdoom.c +++ b/apps/plugins/doom/rockdoom.c @@ -723,7 +723,7 @@ enum plugin_status plugin_start(const void* parameter) systemvol= rb->global_settings->volume-rb->global_settings->volume%mod; general_translucency = default_translucency; // phares - backlight_force_on(); + backlight_ignore_timeout(); #ifdef RB_PROFILE rb->profile_thread(); #endif diff --git a/apps/plugins/fft/fft.c b/apps/plugins/fft/fft.c index 3da3b455f7..2f3b12289d 100644 --- a/apps/plugins/fft/fft.c +++ b/apps/plugins/fft/fft.c @@ -1352,7 +1352,7 @@ enum plugin_status plugin_start(const void* parameter) mylcd_clear_display(); mylcd_update(); #endif - backlight_force_on(); + backlight_ignore_timeout(); #ifdef HAVE_ADJUSTABLE_CPU_FREQ rb->cpu_boost(true); diff --git a/apps/plugins/fire.c b/apps/plugins/fire.c index b03f68b670..797f4f120b 100644 --- a/apps/plugins/fire.c +++ b/apps/plugins/fire.c @@ -278,7 +278,7 @@ void cleanup(void *parameter) grey_release(); #endif /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); } @@ -367,7 +367,7 @@ enum plugin_status plugin_start(const void* parameter) rb->lcd_set_backdrop(NULL); #endif /* Turn off backlight timeout */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); #if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) rb->lcd_set_mode(LCD_MODE_PAL256); diff --git a/apps/plugins/fireworks.c b/apps/plugins/fireworks.c index efb49db4f9..7b0c5228b5 100644 --- a/apps/plugins/fireworks.c +++ b/apps/plugins/fireworks.c @@ -460,7 +460,7 @@ enum plugin_status plugin_start(const void* parameter) /* set everything up.. no BL timeout, no backdrop, white-text-on-black-background. */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); #if LCD_DEPTH > 1 rb->lcd_set_backdrop(NULL); rb->lcd_set_background(LCD_BLACK); @@ -619,7 +619,7 @@ enum plugin_status plugin_start(const void* parameter) } } /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); #ifdef HAVE_ADJUSTABLE_CPU_FREQ rb->cpu_boost(false); diff --git a/apps/plugins/greyscale.c b/apps/plugins/greyscale.c index 00699715f7..42ebbef73b 100644 --- a/apps/plugins/greyscale.c +++ b/apps/plugins/greyscale.c @@ -131,7 +131,7 @@ void cleanup(void *parameter) grey_release(); /* switch off overlay and deinitialize */ /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); } /* this is only a demo of what the framework can do */ @@ -216,7 +216,7 @@ int main(void) }; /* Turn off backlight timeout */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); rb->lcd_setfont(FONT_SYSFIXED); /* select default font */ diff --git a/apps/plugins/imageviewer/imageviewer.c b/apps/plugins/imageviewer/imageviewer.c index 6cc2192cb9..0635a877d4 100644 --- a/apps/plugins/imageviewer/imageviewer.c +++ b/apps/plugins/imageviewer/imageviewer.c @@ -965,7 +965,7 @@ enum plugin_status plugin_start(const void* parameter) rb->memcpy(&old_settings, &settings, sizeof (settings)); /* Turn off backlight timeout */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); #if LCD_DEPTH > 1 rb->lcd_set_backdrop(NULL); @@ -993,7 +993,7 @@ enum plugin_status plugin_start(const void* parameter) #endif /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); #ifdef USEGSLIB grey_release(); /* deinitialize */ diff --git a/apps/plugins/invadrox.c b/apps/plugins/invadrox.c index efabf81379..6b64fa741c 100644 --- a/apps/plugins/invadrox.c +++ b/apps/plugins/invadrox.c @@ -1818,7 +1818,7 @@ enum plugin_status plugin_start(UNUSED const void* parameter) { rb->lcd_setfont(FONT_SYSFIXED); /* Turn off backlight timeout */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); /* now go ahead and have fun! */ game_loop(); @@ -1835,7 +1835,7 @@ enum plugin_status plugin_start(UNUSED const void* parameter) /* Restore user's original backlight setting */ rb->lcd_setfont(FONT_UI); /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); return PLUGIN_OK; } diff --git a/apps/plugins/lib/helper.c b/apps/plugins/lib/helper.c index ce84915e02..780d636f41 100644 --- a/apps/plugins/lib/helper.c +++ b/apps/plugins/lib/helper.c @@ -36,8 +36,17 @@ const unsigned bit_n_table[32] = { }; #endif -/* Force the backlight on */ +/* Force the backlight on */ void backlight_force_on(void) +{ + rb->backlight_set_timeout(0); +#if CONFIG_CHARGING + rb->backlight_set_timeout_plugged(0); +#endif /* CONFIG_CHARGING */ +} + +/* Turn off backlight timeout */ +void backlight_ignore_timeout(void) { if (rb->global_settings->backlight_timeout > 0) rb->backlight_set_timeout(0); @@ -60,6 +69,15 @@ void backlight_use_settings(void) #ifdef HAVE_REMOTE_LCD /* Force the backlight on */ void remote_backlight_force_on(void) +{ + rb->remote_backlight_set_timeout(0); +#if CONFIG_CHARGING + rb->remote_backlight_set_timeout_plugged(0); +#endif /* CONFIG_CHARGING */ +} + +/* Turn off backlight timeout */ +void remote_backlight_ignore_timeout(void) { if (rb->global_settings->remote_backlight_timeout > 0) rb->remote_backlight_set_timeout(0); @@ -84,6 +102,12 @@ void remote_backlight_use_settings(void) #ifdef HAVE_BUTTON_LIGHT /* Force the buttonlight on */ void buttonlight_force_on(void) +{ + rb->buttonlight_set_timeout(0); +} + +/* Turn off backlight timeout */ +void buttonlight_ignore_timeout(void) { if (rb->global_settings->buttonlight_timeout > 0) rb->buttonlight_set_timeout(0); diff --git a/apps/plugins/lib/helper.h b/apps/plugins/lib/helper.h index 26baf0f6cd..20f5ee285b 100644 --- a/apps/plugins/lib/helper.h +++ b/apps/plugins/lib/helper.h @@ -27,14 +27,17 @@ * Backlight on/off operations */ void backlight_force_on(void); +void backlight_ignore_timeout(void); void backlight_use_settings(void); #ifdef HAVE_REMOTE_LCD void remote_backlight_force_on(void); +void remote_backlight_ignore_timeout(void); void remote_backlight_use_settings(void); #endif #ifdef HAVE_BUTTON_LIGHT void buttonlight_force_on(void); +void buttonlight_ignore_timeout(void); void buttonlight_use_settings(void); #endif diff --git a/apps/plugins/lrcplayer.c b/apps/plugins/lrcplayer.c index c31b607414..8e9878f78b 100644 --- a/apps/plugins/lrcplayer.c +++ b/apps/plugins/lrcplayer.c @@ -2320,7 +2320,7 @@ static bool lrc_theme_menu(void) #ifdef HAVE_LCD_COLOR "Inactive Colour", #endif - "Backlight Force On"); + "Backlight Always On"); while (!exit && !usb) { @@ -2344,7 +2344,7 @@ static bool lrc_theme_menu(void) break; #endif case LRC_MENU_BACKLIGHT: - usb = rb->set_bool("Backlight Force On", &prefs.backlight_on); + usb = rb->set_bool("Backlight Always On", &prefs.backlight_on); break; case MENU_ATTACHED_USB: usb = true; @@ -2797,7 +2797,7 @@ static int lrc_main(void) } if (prefs.backlight_on) - backlight_force_on(); + backlight_ignore_timeout(); #ifdef HAVE_LCD_BITMAP /* in case settings that may affect break position diff --git a/apps/plugins/maze.c b/apps/plugins/maze.c index 231b602911..e84173944b 100644 --- a/apps/plugins/maze.c +++ b/apps/plugins/maze.c @@ -497,7 +497,7 @@ enum plugin_status plugin_start(const void* parameter) (void)parameter; /* Turn off backlight timeout */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); /* Seed the RNG */ rb->srand(*rb->current_tick); @@ -585,6 +585,6 @@ enum plugin_status plugin_start(const void* parameter) lastbutton = button; } /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); return ((quit == 1) ? PLUGIN_OK : PLUGIN_USB_CONNECTED); } diff --git a/apps/plugins/mazezam.c b/apps/plugins/mazezam.c index bb93825453..759ca6477d 100644 --- a/apps/plugins/mazezam.c +++ b/apps/plugins/mazezam.c @@ -256,7 +256,7 @@ static void store_lcd_settings(void) ******************************************************************************/ static void restore_lcd_settings(void) { /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); /* Restore the old settings */ #if LCD_DEPTH > 1 @@ -271,7 +271,7 @@ static void restore_lcd_settings(void) { ******************************************************************************/ static void plugin_lcd_settings(void) { /* Turn off backlight timeout */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); /* Set the new settings */ #ifdef HAVE_LCD_COLOR diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c index 5ea17f9a3e..97f648621a 100644 --- a/apps/plugins/mpegplayer/mpegplayer.c +++ b/apps/plugins/mpegplayer/mpegplayer.c @@ -822,8 +822,7 @@ static void osd_backlight_on_video_mode(bool video_on) { if (video_on) { /* Turn off backlight timeout */ - /* backlight control in lib/helper.c */ - backlight_force_on(); + backlight_ignore_timeout(); #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) rb->remove_event(LCD_EVENT_ACTIVATION, osd_lcd_enable_hook); #endif diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c index f80b9c014a..c55948dce9 100644 --- a/apps/plugins/oscilloscope.c +++ b/apps/plugins/oscilloscope.c @@ -780,7 +780,7 @@ void cleanup(void) rb->lcd_set_background(LCD_DEFAULT_BG); #endif /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); } enum plugin_status plugin_start(const void* parameter) @@ -808,7 +808,7 @@ enum plugin_status plugin_start(const void* parameter) #endif /* Turn off backlight timeout */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); rb->lcd_getstringsize("A", NULL, &font_height); diff --git a/apps/plugins/pdbox/pdbox.c b/apps/plugins/pdbox/pdbox.c index 3ba6f4e2cb..f21913788b 100644 --- a/apps/plugins/pdbox/pdbox.c +++ b/apps/plugins/pdbox/pdbox.c @@ -245,7 +245,7 @@ enum plugin_status plugin_start(const void* parameter) return PLUGIN_ERROR; /* Make backlight remain on -- making music requires attention. */ - backlight_force_on(); + backlight_ignore_timeout(); /* Main loop. */ while(!quit) diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c index c2f07b8d70..caae9dc163 100644 --- a/apps/plugins/pictureflow/pictureflow.c +++ b/apps/plugins/pictureflow/pictureflow.c @@ -2203,7 +2203,7 @@ void cleanup(void) #endif end_pf_thread(); /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); #ifdef USEGSLIB grey_release(); @@ -2666,7 +2666,7 @@ int main(void) draw_splashscreen(); if(backlight_mode == 0) { /* Turn off backlight timeout */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); } init_scroll_lines(); diff --git a/apps/plugins/pitch_detector.c b/apps/plugins/pitch_detector.c index fe31b3c768..324a36bce7 100644 --- a/apps/plugins/pitch_detector.c +++ b/apps/plugins/pitch_detector.c @@ -547,7 +547,7 @@ static bool main_menu(void) } } - backlight_force_on(); + backlight_ignore_timeout(); return exit_tuner; } @@ -995,7 +995,7 @@ static void record_and_get_pitch(void) audio_tail = 1; #endif - backlight_force_on(); + backlight_ignore_timeout(); record_data(); diff --git a/apps/plugins/plasma.c b/apps/plugins/plasma.c index 58d903cb06..52f4204a17 100644 --- a/apps/plugins/plasma.c +++ b/apps/plugins/plasma.c @@ -139,7 +139,7 @@ void cleanup(void) grey_release(); #endif /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); #if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) rb->lcd_set_mode(LCD_MODE_RGB565); #endif @@ -317,7 +317,7 @@ enum plugin_status plugin_start(const void* parameter) rb->lcd_set_backdrop(NULL); #endif /* Turn off backlight timeout */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); #if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) rb->lcd_set_mode(LCD_MODE_PAL256); diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c index 9394b7a857..bae1703db5 100644 --- a/apps/plugins/pong.c +++ b/apps/plugins/pong.c @@ -659,7 +659,7 @@ enum plugin_status plugin_start(const void* parameter) (void)parameter; /* Turn off backlight timeout */ - backlight_force_on(); + backlight_ignore_timeout(); /* Clear screen */ rb->lcd_clear_display(); diff --git a/apps/plugins/resistor.c b/apps/plugins/resistor.c index eb02ce6d8d..1967335469 100644 --- a/apps/plugins/resistor.c +++ b/apps/plugins/resistor.c @@ -574,7 +574,7 @@ static void display_helpfile(void) static void led_resistance_calc(void) { - backlight_force_on(); + backlight_ignore_timeout(); int voltage_menu_selection, button_press, j, k, l, foreward_current = 0; int fwd_current_selection = 0; bool quit = false; @@ -779,7 +779,7 @@ static void led_resistance_calc(void) static void resistance_to_color(void) { - backlight_force_on(); + backlight_ignore_timeout(); int menu_selection; int menu_selection_tol; int button_press; @@ -916,7 +916,7 @@ static void resistance_to_color(void) static void color_to_resistance(void) { - backlight_force_on(); + backlight_ignore_timeout(); bool quit = false; int button_input = 0; diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c index 6d5ef8023e..d86cb1c293 100644 --- a/apps/plugins/rockblox.c +++ b/apps/plugins/rockblox.c @@ -1345,13 +1345,13 @@ static int rockblox_loop (void) #ifdef HAS_BUTTON_HOLD if (rb->button_hold ()) { /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); rb->splash(0, "Paused"); while (rb->button_hold ()) rb->sleep(HZ/10); /* Turn off backlight timeout */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); /* get rid of the splash text */ rb->lcd_bitmap (rockblox_background, 0, 0, LCD_WIDTH, LCD_HEIGHT); @@ -1527,7 +1527,7 @@ enum plugin_status plugin_start (const void *parameter) } #endif /* Turn off backlight timeout */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); load_game(); resume_file = resume; while(!rockblox_loop()) { @@ -1548,7 +1548,7 @@ enum plugin_status plugin_start (const void *parameter) #endif /* Save user's HighScore */ highscore_save(SCORE_FILE, highscores, NUM_SCORES); - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); return PLUGIN_OK; } diff --git a/apps/plugins/rockboy/menu.c b/apps/plugins/rockboy/menu.c index 0156a3fdd2..54a0db76f5 100644 --- a/apps/plugins/rockboy/menu.c +++ b/apps/plugins/rockboy/menu.c @@ -139,7 +139,7 @@ int do_user_menu(void) { #endif /* ignore backlight time out */ - backlight_force_on(); + backlight_ignore_timeout(); return ret; } diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c index b3fccbf8d8..01a706be45 100644 --- a/apps/plugins/rockboy/rockboy.c +++ b/apps/plugins/rockboy/rockboy.c @@ -450,7 +450,7 @@ enum plugin_status plugin_start(const void* parameter) #endif /* ignore backlight time out */ - backlight_force_on(); + backlight_ignore_timeout(); gnuboy_main(parameter); diff --git a/apps/plugins/rocklife.c b/apps/plugins/rocklife.c index 8ae5cdb120..4b00d7e18a 100644 --- a/apps/plugins/rocklife.c +++ b/apps/plugins/rocklife.c @@ -473,7 +473,7 @@ enum plugin_status plugin_start(const void* parameter) char *ptemp; (void)(parameter); - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); #if LCD_DEPTH > 1 rb->lcd_set_backdrop(NULL); #ifdef HAVE_LCD_COLOR @@ -577,6 +577,6 @@ enum plugin_status plugin_start(const void* parameter) rb->yield(); } - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); return usb? PLUGIN_USB_CONNECTED: PLUGIN_OK; } diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c index 59463b3c97..2e5600bc79 100644 --- a/apps/plugins/spacerocks.c +++ b/apps/plugins/spacerocks.c @@ -2009,7 +2009,7 @@ enum plugin_status plugin_start(const void* parameter) /* universal font */ rb->lcd_setfont(FONT_SYSFIXED); /* Turn off backlight timeout */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); highscore_load(SCORE_FILE, highscores, NUM_SCORES); rb->srand(*rb->current_tick); @@ -2022,7 +2022,7 @@ enum plugin_status plugin_start(const void* parameter) rb->lcd_setfont(FONT_UI); highscore_save(SCORE_FILE, highscores, NUM_SCORES); /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); return ret; } diff --git a/apps/plugins/starfield.c b/apps/plugins/starfield.c index d06998ee2c..9d4be34629 100644 --- a/apps/plugins/starfield.c +++ b/apps/plugins/starfield.c @@ -523,12 +523,12 @@ enum plugin_status plugin_start(const void* parameter) (void)parameter; /* Turn off backlight timeout */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); ret = plugin_main(); /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(); /* backlight control in lib/helper.c*/ + backlight_use_settings(); return ret; } diff --git a/apps/plugins/test_disk.c b/apps/plugins/test_disk.c index dd0758aec9..b211bc774e 100644 --- a/apps/plugins/test_disk.c +++ b/apps/plugins/test_disk.c @@ -441,7 +441,7 @@ enum plugin_status plugin_start(const void* parameter) rb->srand(*rb->current_tick); /* Turn off backlight timeout */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); while(!quit) { @@ -460,7 +460,7 @@ enum plugin_status plugin_start(const void* parameter) } /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); rb->rmdir(testbasedir); diff --git a/apps/plugins/test_fps.c b/apps/plugins/test_fps.c index 295c172524..6851f6739f 100644 --- a/apps/plugins/test_fps.c +++ b/apps/plugins/test_fps.c @@ -367,7 +367,7 @@ enum plugin_status plugin_start(const void* parameter) #if (CONFIG_PLATFORM & PLATFORM_NATIVE) cpu_freq = *rb->cpu_frequency; /* remember CPU frequency */ #endif - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); time_main_update(); rb->sleep(HZ); @@ -389,7 +389,7 @@ enum plugin_status plugin_start(const void* parameter) (cpu_freq + 500000) / 1000000); log_text(str); #endif - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); /* wait until user closes plugin */ while (rb->button_get(true) != FPS_QUIT); diff --git a/apps/plugins/test_gfx.c b/apps/plugins/test_gfx.c index aa898549bb..cde77c55fe 100644 --- a/apps/plugins/test_gfx.c +++ b/apps/plugins/test_gfx.c @@ -441,7 +441,7 @@ enum plugin_status plugin_start(const void* parameter) rb->lcd_set_backdrop(NULL); rb->lcd_clear_display(); #endif - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); rb->splashf(0, "LCD driver performance test, please wait %d sec", 6*4*DURATION/HZ); diff --git a/apps/plugins/test_grey.c b/apps/plugins/test_grey.c index bf6d1755af..efceeff2c3 100644 --- a/apps/plugins/test_grey.c +++ b/apps/plugins/test_grey.c @@ -184,7 +184,7 @@ enum plugin_status plugin_start(const void* parameter) for (i = 0; i <= STEPS; i++) input_levels[i] = lcd_levels[i] = (255 * i + (STEPS/2)) / STEPS; - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); grey_set_background(0); /* set background to black */ grey_clear_display(); @@ -279,6 +279,6 @@ enum plugin_status plugin_start(const void* parameter) } grey_release(); - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); return PLUGIN_OK; } diff --git a/apps/plugins/video.c b/apps/plugins/video.c index 869a053886..c8f9673a25 100644 --- a/apps/plugins/video.c +++ b/apps/plugins/video.c @@ -585,7 +585,7 @@ void Cleanup(void *fd) rb->mp3_play_stop(); /* stop audio ISR */ /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); /* restore normal contrast */ rb->lcd_set_contrast(rb->global_settings->contrast); @@ -954,7 +954,7 @@ int main(char* filename) { gPlay.bHasVideo = true; /* Turn off backlight timeout */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); } /* prepare audio playback, if contained */ diff --git a/apps/plugins/wormlet.c b/apps/plugins/wormlet.c index e2076f75bd..ba5eb24967 100644 --- a/apps/plugins/wormlet.c +++ b/apps/plugins/wormlet.c @@ -2313,7 +2313,7 @@ static bool launch_wormlet(void) rb->lcd_clear_display(); /* Turn off backlight timeout */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); /* start the game */ while (game_result == 1) @@ -2323,7 +2323,7 @@ static bool launch_wormlet(void) { case 2: /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); return false; break; } diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c index 49efdc9914..920bc23080 100644 --- a/apps/plugins/xobox.c +++ b/apps/plugins/xobox.c @@ -1110,13 +1110,13 @@ enum plugin_status plugin_start (const void *parameter) #endif /* Turn off backlight timeout */ - backlight_force_on(); /* backlight control in lib/helper.c */ + backlight_ignore_timeout(); randomize (); ret = xobox_loop (); /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(); /* backlight control in lib/helper.c */ + backlight_use_settings(); rb->lcd_setfont (FONT_UI); return ret; -- cgit v1.2.3