summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/usb_screen.c4
-rw-r--r--apps/misc.c3
-rw-r--r--apps/screens.c12
3 files changed, 9 insertions, 10 deletions
diff --git a/apps/gui/usb_screen.c b/apps/gui/usb_screen.c
index f74747fd5c..527ae9fd15 100644
--- a/apps/gui/usb_screen.c
+++ b/apps/gui/usb_screen.c
@@ -91,6 +91,10 @@ static int handle_usb_events(void)
91 case SYS_USB_DISCONNECTED: 91 case SYS_USB_DISCONNECTED:
92 usb_acknowledge(SYS_USB_DISCONNECTED_ACK); 92 usb_acknowledge(SYS_USB_DISCONNECTED_ACK);
93 return 1; 93 return 1;
94 case SYS_CHARGER_DISCONNECTED:
95 /*reset rockbox battery runtime*/
96 global_status.runtime = 0;
97 break;
94 case SYS_TIMEOUT: 98 case SYS_TIMEOUT:
95 break; 99 break;
96 } 100 }
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
590 system_restore(); 590 system_restore();
591 } 591 }
592 return SYS_USB_CONNECTED; 592 return SYS_USB_CONNECTED;
593
593 case SYS_POWEROFF: 594 case SYS_POWEROFF:
594 if (!clean_shutdown(callback, parameter)) 595 if (!clean_shutdown(callback, parameter))
595 return SYS_POWEROFF; 596 return SYS_POWEROFF;
@@ -601,6 +602,8 @@ long default_event_handler_ex(long event, void (*callback)(void *), void *parame
601 602
602 case SYS_CHARGER_DISCONNECTED: 603 case SYS_CHARGER_DISCONNECTED:
603 car_adapter_mode_processing(false); 604 car_adapter_mode_processing(false);
605 /*reset rockbox battery runtime*/
606 global_status.runtime = 0;
604 return SYS_CHARGER_DISCONNECTED; 607 return SYS_CHARGER_DISCONNECTED;
605 608
606 case SYS_CAR_ADAPTER_RESUME: 609 case SYS_CAR_ADAPTER_RESUME:
diff --git a/apps/screens.c b/apps/screens.c
index 92b174b55c..65ab1094d3 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -825,16 +825,8 @@ bool view_runtime(void)
825 gui_synclist_speak_item(&lists); 825 gui_synclist_speak_item(&lists);
826 while(1) 826 while(1)
827 { 827 {
828#if CONFIG_CHARGING 828 global_status.runtime += ((current_tick - lasttime) / HZ);
829 if (charger_inserted()) 829
830 {
831 global_status.runtime = 0;
832 }
833 else
834#endif
835 {
836 global_status.runtime += ((current_tick - lasttime) / HZ);
837 }
838 lasttime = current_tick; 830 lasttime = current_tick;
839 gui_synclist_draw(&lists); 831 gui_synclist_draw(&lists);
840 list_do_action(CONTEXT_STD, HZ, 832 list_do_action(CONTEXT_STD, HZ,