Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

settings.c make lasttime static

statusbar can use reset_runtime() and we can ensure topruntime gets updated
before clear

Change-Id: I3712649fc394c42f911ec88404c831422872c25b

authored by

William Wilgus and committed by
William Wilgus
db477bde 2debcf2c

+4 -5
+2 -2
apps/gui/statusbar.c
··· 192 192 193 193 /* zero battery run time if charging */ 194 194 if (charge_state > DISCHARGING) 195 - lasttime = current_tick; 195 + reset_runtime(); 196 196 197 197 /* animate battery if charging */ 198 198 if ((charge_state == DISCHARGING) || (charge_state == TRICKLE)) ··· 202 202 else 203 203 { 204 204 #else /* CONFIG_CHARGING < CHARGING_MONITOR */ 205 - lasttime = current_tick; 205 + reset_runtime(); 206 206 { 207 207 #endif /* CONFIG_CHARGING < CHARGING_MONITOR */ 208 208 /* animate in (max.) 4 steps, starting near the current charge level */
+2 -1
apps/settings.c
··· 80 80 struct system_status global_status; 81 81 static uint32_t user_settings_crc; 82 82 static long next_status_update_tick; 83 - long lasttime = 0; 83 + static long lasttime = 0; 84 84 85 85 /* flush system_status more often for spinning harddisks as we may not be able 86 86 * to spin up at shutdown in order to save so keep the gap minimal */ ··· 636 636 637 637 void reset_runtime(void) 638 638 { 639 + update_runtime(); /* in case this is > topruntimetime */ 639 640 lasttime = current_tick; 640 641 global_status.runtime = 0; 641 642 }
-2
apps/settings.h
··· 914 914 bool playback_log; /* ROCKBOX_DIR/playback.log for tracks played */ 915 915 }; 916 916 917 - /** global variables **/ 918 - extern long lasttime; 919 917 /* global settings */ 920 918 extern struct user_settings global_settings; 921 919 /* global status */