forked from len0rd/rockbox
settings.c make lasttime static
statusbar can use reset_runtime() and we can ensure topruntime gets updated before clear Change-Id: I3712649fc394c42f911ec88404c831422872c25b
This commit is contained in:
parent
2debcf2c1f
commit
db477bdeda
3 changed files with 4 additions and 5 deletions
|
|
@ -192,7 +192,7 @@ static struct screen * sb_fill_bar_info(struct gui_statusbar * bar)
|
||||||
|
|
||||||
/* zero battery run time if charging */
|
/* zero battery run time if charging */
|
||||||
if (charge_state > DISCHARGING)
|
if (charge_state > DISCHARGING)
|
||||||
lasttime = current_tick;
|
reset_runtime();
|
||||||
|
|
||||||
/* animate battery if charging */
|
/* animate battery if charging */
|
||||||
if ((charge_state == DISCHARGING) || (charge_state == TRICKLE))
|
if ((charge_state == DISCHARGING) || (charge_state == TRICKLE))
|
||||||
|
|
@ -202,7 +202,7 @@ static struct screen * sb_fill_bar_info(struct gui_statusbar * bar)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#else /* CONFIG_CHARGING < CHARGING_MONITOR */
|
#else /* CONFIG_CHARGING < CHARGING_MONITOR */
|
||||||
lasttime = current_tick;
|
reset_runtime();
|
||||||
{
|
{
|
||||||
#endif /* CONFIG_CHARGING < CHARGING_MONITOR */
|
#endif /* CONFIG_CHARGING < CHARGING_MONITOR */
|
||||||
/* animate in (max.) 4 steps, starting near the current charge level */
|
/* animate in (max.) 4 steps, starting near the current charge level */
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ struct user_settings global_settings;
|
||||||
struct system_status global_status;
|
struct system_status global_status;
|
||||||
static uint32_t user_settings_crc;
|
static uint32_t user_settings_crc;
|
||||||
static long next_status_update_tick;
|
static long next_status_update_tick;
|
||||||
long lasttime = 0;
|
static long lasttime = 0;
|
||||||
|
|
||||||
/* flush system_status more often for spinning harddisks as we may not be able
|
/* flush system_status more often for spinning harddisks as we may not be able
|
||||||
* to spin up at shutdown in order to save so keep the gap minimal */
|
* to spin up at shutdown in order to save so keep the gap minimal */
|
||||||
|
|
@ -636,6 +636,7 @@ static void flush_config_block_callback(void)
|
||||||
|
|
||||||
void reset_runtime(void)
|
void reset_runtime(void)
|
||||||
{
|
{
|
||||||
|
update_runtime(); /* in case this is > topruntimetime */
|
||||||
lasttime = current_tick;
|
lasttime = current_tick;
|
||||||
global_status.runtime = 0;
|
global_status.runtime = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -914,8 +914,6 @@ struct user_settings
|
||||||
bool playback_log; /* ROCKBOX_DIR/playback.log for tracks played */
|
bool playback_log; /* ROCKBOX_DIR/playback.log for tracks played */
|
||||||
};
|
};
|
||||||
|
|
||||||
/** global variables **/
|
|
||||||
extern long lasttime;
|
|
||||||
/* global settings */
|
/* global settings */
|
||||||
extern struct user_settings global_settings;
|
extern struct user_settings global_settings;
|
||||||
/* global status */
|
/* global status */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue