Fix reset runtime

Change-Id: Ic1ba0c7c7883aae43100c67235dbc2db83056fe7
This commit is contained in:
Mihail Zenkov 2016-03-30 22:25:24 +00:00 committed by Gerrit Rockbox
parent 134e5914a1
commit 6228c8da18
4 changed files with 8 additions and 4 deletions

View File

@ -96,8 +96,7 @@ static int handle_usb_events(void)
case SYS_USB_DISCONNECTED:
return 1;
case SYS_CHARGER_DISCONNECTED:
/*reset rockbox battery runtime*/
global_status.runtime = 0;
reset_runtime();
break;
case SYS_TIMEOUT:
break;

View File

@ -576,8 +576,7 @@ long default_event_handler_ex(long event, void (*callback)(void *), void *parame
case SYS_CHARGER_DISCONNECTED:
car_adapter_mode_processing(false);
/*reset rockbox battery runtime*/
global_status.runtime = 0;
reset_runtime();
return SYS_CHARGER_DISCONNECTED;
case SYS_CAR_ADAPTER_RESUME:

View File

@ -608,6 +608,11 @@ static void flush_config_block_callback(void)
settings_write_config(CONFIGFILE, SETTINGS_SAVE_CHANGED);
}
void reset_runtime(void) {
lasttime = current_tick;
global_status.runtime = 0;
}
/*
* persist all runtime user settings to disk or RTC RAM
*/

View File

@ -196,6 +196,7 @@ bool settings_load_config(const char* file, bool apply);
void status_save(void);
int settings_save(void);
void reset_runtime(void);
/* defines for the options paramater */
enum {
SETTINGS_SAVE_CHANGED = 0,