Moved runtime-reset-when-charger-connected to status.c

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2925 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2002-12-04 11:25:56 +00:00
parent 34c03ef8bc
commit 34351e8251
2 changed files with 5 additions and 8 deletions

View file

@ -349,14 +349,9 @@ int settings_save( void )
{
static long lasttime = 0;
/* reset counter if charger is inserted */
if ( charger_inserted() ) {
global_settings.runtime = 0;
}
else {
global_settings.runtime += (current_tick - lasttime) / HZ;
lasttime = current_tick;
}
global_settings.runtime += (current_tick - lasttime) / HZ;
lasttime = current_tick;
if ( global_settings.runtime > global_settings.topruntime )
global_settings.topruntime = global_settings.runtime;