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 #endif 209 } 210 211 212 static void gwps_leave_wps(void) 213 { ··· 225 show_remote_main_backdrop(); 226 #endif 227 viewportmanager_set_statusbar(oldbars); 228 } 229 230 void gwps_draw_statusbars(void) ··· 663 if (wps_state.do_full_update || update) 664 { 665 FOR_NB_SCREENS(i) 666 { 667 - gui_wps_update(&gui_wps[i]); 668 } 669 wps_state.do_full_update = false; 670 update = false; ··· 677 restore = false; 678 restoretimer = RESTORE_WPS_INSTANTLY; 679 gwps_fix_statusbars(); 680 FOR_NB_SCREENS(i) 681 { 682 screens[i].stop_scroll();
··· 208 #endif 209 } 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 225 226 static void gwps_leave_wps(void) 227 { ··· 239 show_remote_main_backdrop(); 240 #endif 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 246 } 247 248 void gwps_draw_statusbars(void) ··· 681 if (wps_state.do_full_update || update) 682 { 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 693 { 694 + gui_wps_update(&gui_wps[i]); 695 } 696 wps_state.do_full_update = false; 697 update = false; ··· 704 restore = false; 705 restoretimer = RESTORE_WPS_INSTANTLY; 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 710 FOR_NB_SCREENS(i) 711 { 712 screens[i].stop_scroll();