summaryrefslogtreecommitdiff
path: root/apps/settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings.c')
-rw-r--r--apps/settings.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/apps/settings.c b/apps/settings.c
index 3bfbd9670f..cd838b9627 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -349,14 +349,9 @@ int settings_save( void )
349 { 349 {
350 static long lasttime = 0; 350 static long lasttime = 0;
351 351
352 /* reset counter if charger is inserted */ 352 global_settings.runtime += (current_tick - lasttime) / HZ;
353 if ( charger_inserted() ) { 353 lasttime = current_tick;
354 global_settings.runtime = 0; 354
355 }
356 else {
357 global_settings.runtime += (current_tick - lasttime) / HZ;
358 lasttime = current_tick;
359 }
360 if ( global_settings.runtime > global_settings.topruntime ) 355 if ( global_settings.runtime > global_settings.topruntime )
361 global_settings.topruntime = global_settings.runtime; 356 global_settings.topruntime = global_settings.runtime;
362 357