A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

FS#8523 - Disable WPS updating when the backlight is off. Disables WPS updating when the lcd is inactive (sleep or disabled, backlight doesn't count in), which prevents a good deal of code from running uselessly. According to tests, it can yield up to 1h more battery life in cases of heavy WPSes.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20666 a1c6a512-1295-4272-9138-f99709370657

+31 -1
+31 -1
apps/gui/gwps.c
··· 208 208 #endif 209 209 } 210 210 211 + #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) 212 + /* 213 + * If the user is unable to see the wps, because the display is deactivated, 214 + * we surpress updates until the wps gets actived again (the lcd driver will 215 + * call this hook) 216 + * */ 217 + static void wps_lcd_activation_hook(void) 218 + { 219 + /* issue an update */ 220 + wps_state.do_full_update = true; 221 + /* force timeout in wps main loop, so that the update is instantly */ 222 + queue_post(&button_queue, BUTTON_NONE, 0); 223 + } 224 + #endif 211 225 212 226 static void gwps_leave_wps(void) 213 227 { ··· 225 239 show_remote_main_backdrop(); 226 240 #endif 227 241 viewportmanager_set_statusbar(oldbars); 242 + #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) 243 + /* Play safe and unregister the hook */ 244 + lcd_activation_set_hook(NULL); 245 + #endif 228 246 } 229 247 230 248 void gwps_draw_statusbars(void) ··· 663 681 if (wps_state.do_full_update || update) 664 682 { 665 683 FOR_NB_SCREENS(i) 684 + #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) 685 + if (lcd_active() 686 + #ifdef HAVE_REMOTE_LCD 687 + /* currently, all remotes are readable without backlight 688 + * so still update those */ 689 + && (i == SCREEN_MAIN) 690 + #endif 691 + ) 692 + #endif 666 693 { 667 - gui_wps_update(&gui_wps[i]); 694 + gui_wps_update(&gui_wps[i]); 668 695 } 669 696 wps_state.do_full_update = false; 670 697 update = false; ··· 677 704 restore = false; 678 705 restoretimer = RESTORE_WPS_INSTANTLY; 679 706 gwps_fix_statusbars(); 707 + #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) 708 + lcd_activation_set_hook(wps_lcd_activation_hook); 709 + #endif 680 710 FOR_NB_SCREENS(i) 681 711 { 682 712 screens[i].stop_scroll();