From 1fefb48e871cee8328d8f9a5d375cde0627e603a Mon Sep 17 00:00:00 2001 From: Michael Giacomelli Date: Sat, 27 Feb 2010 22:47:49 +0000 Subject: Fix System/Running Time to reset the running time whenever a charger or USB cable is inserted, not just when the cable is inserted in the running time screen. Should now make the running time actually be the amount of time rockbox has run since the battery was last charged, which is as far as I can tell the original idea behind the runtime menu. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24954 a1c6a512-1295-4272-9138-f99709370657 --- apps/misc.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'apps/misc.c') diff --git a/apps/misc.c b/apps/misc.c index 8c60e32559..554d29e630 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -590,6 +590,7 @@ long default_event_handler_ex(long event, void (*callback)(void *), void *parame system_restore(); } return SYS_USB_CONNECTED; + case SYS_POWEROFF: if (!clean_shutdown(callback, parameter)) return SYS_POWEROFF; @@ -601,6 +602,8 @@ 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; return SYS_CHARGER_DISCONNECTED; case SYS_CAR_ADAPTER_RESUME: -- cgit v1.2.3