Index: apps/gui/gwps-common.c =================================================================== --- apps/gui/gwps-common.c (Revision 20127) +++ apps/gui/gwps-common.c (Arbeitskopie) @@ -1976,16 +1976,72 @@ #endif +#ifdef HAVE_BACKLIGHT + if (global_settings.caption_backlight && state->id3) + { + /* turn on backlight n seconds before track ends, and turn it off n + seconds into the new track. n == backlight_timeout, or 5s */ + int n = global_settings.backlight_timeout * 1000; + + if ( n < 1000 ) + n = 5000; /* use 5s if backlight is always on or off */ + + if (((state->id3->elapsed < 1000) || + ((state->id3->length - state->id3->elapsed) < (unsigned)n)) && + (state->paused == false)) + backlight_on(); + } +#endif +#ifdef HAVE_REMOTE_LCD + if (global_settings.remote_caption_backlight && state->id3) + { + /* turn on remote backlight n seconds before track ends, and turn it + off n seconds into the new track. n == remote_backlight_timeout, + or 5s */ + int n = global_settings.remote_backlight_timeout * 1000; + + if ( n < 1000 ) + n = 5000; /* use 5s if backlight is always on or off */ + + if (((state->id3->elapsed < 1000) || + ((state->id3->length - state->id3->elapsed) < (unsigned)n)) && + (state->paused == false)) + remote_backlight_on(); + } +#endif +/* disable wps updating if lcd is disabled */ +#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) + bool exit = false; +#ifdef HAVE_LCD_ENABLE + if (!lcd_enabled() +#elif defined(HAVE_LCD_SLEEP) /* e.g. ipod video */ + if (lcd_asleep() +#endif +#ifdef HAVE_REMOTE_LCD + && !is_remote_backlight_on() +#endif + ) + { + exit = true; + /* reset sublines to avoid fast subline changing when backlight is + * on again */ + goto reset_sublines; + } +#endif /* reset to first subline if refresh all flag is set */ if (refresh_mode == WPS_REFRESH_ALL) { display->set_viewport(&data->viewports[0].vp); display->clear_viewport(); - +reset_sublines: for (i = 0; i <= data->num_lines; i++) { data->lines[i].curr_subline = SUBLINE_RESET; } +#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) + if (exit) + return true; +#endif } #ifdef HAVE_LCD_CHARCELLS @@ -2150,39 +2206,6 @@ display->update(); -#ifdef HAVE_BACKLIGHT - if (global_settings.caption_backlight && state->id3) - { - /* turn on backlight n seconds before track ends, and turn it off n - seconds into the new track. n == backlight_timeout, or 5s */ - int n = global_settings.backlight_timeout * 1000; - - if ( n < 1000 ) - n = 5000; /* use 5s if backlight is always on or off */ - - if (((state->id3->elapsed < 1000) || - ((state->id3->length - state->id3->elapsed) < (unsigned)n)) && - (state->paused == false)) - backlight_on(); - } -#endif -#ifdef HAVE_REMOTE_LCD - if (global_settings.remote_caption_backlight && state->id3) - { - /* turn on remote backlight n seconds before track ends, and turn it - off n seconds into the new track. n == remote_backlight_timeout, - or 5s */ - int n = global_settings.remote_backlight_timeout * 1000; - - if ( n < 1000 ) - n = 5000; /* use 5s if backlight is always on or off */ - - if (((state->id3->elapsed < 1000) || - ((state->id3->length - state->id3->elapsed) < (unsigned)n)) && - (state->paused == false)) - remote_backlight_on(); - } -#endif /* force a bars update if they are being displayed */ viewportmanager_draw_statusbars(NULL); return true; Index: firmware/export/lcd.h =================================================================== --- firmware/export/lcd.h (Revision 20127) +++ firmware/export/lcd.h (Arbeitskopie) @@ -355,6 +355,10 @@ #ifdef HAVE_LCD_SLEEP /* Put the LCD into a power saving state deeper than lcd_enable(false). */ extern void lcd_sleep(void); +#ifndef HAVE_LCD_ENABLE +/* lcd_asleep() is only implemented if lcd_enable is not available */ +extern bool lcd_asleep(void); +#endif #endif /* HAVE_LCD_SLEEP */ #ifdef HAVE_LCD_SHUTDOWN Index: firmware/target/arm/ipod/video/lcd-video.c =================================================================== --- firmware/target/arm/ipod/video/lcd-video.c (Revision 20127) +++ firmware/target/arm/ipod/video/lcd-video.c (Arbeitskopie) @@ -600,6 +600,11 @@ mutex_unlock(&lcdstate_lock); } +bool lcd_asleep(void) +{ + return !(lcd_state.display_on); +} + #ifdef HAVE_LCD_SHUTDOWN void lcd_shutdown(void) { Index: firmware/scroll_engine.c =================================================================== --- firmware/scroll_engine.c (Revision 20127) +++ firmware/scroll_engine.c (Arbeitskopie) @@ -305,8 +305,10 @@ if (scroll & SCROLL_LCD) { -#ifdef HAVE_LCD_ENABLE +#if defined(HAVE_LCD_ENABLE) if (lcd_enabled()) +#elif defined(HAVE_LCD_SLEEP) + if (!lcd_asleep()) #endif lcd_scroll_fn(); lcd_scroll_info.last_scroll = current_tick; @@ -328,8 +330,10 @@ while (1) { sleep(lcd_scroll_info.ticks); -#ifdef HAVE_LCD_ENABLE +#if defined(HAVE_LCD_ENABLE) if (lcd_enabled()) +#elif defined(HAVE_LCD_SLEEP) + if (!lcd_asleep()) #endif lcd_scroll_fn(); }