diff options
| author | Björn Stenberg <bjorn@haxx.se> | 2003-10-17 13:54:48 +0000 |
|---|---|---|
| committer | Björn Stenberg <bjorn@haxx.se> | 2003-10-17 13:54:48 +0000 |
| commit | fb067481a8d2ec5c890fab5860ab246d019eecc9 (patch) | |
| tree | 9f5c0d8d3f808cc662abc1be3386e9c783027366 /apps | |
| parent | 2ec8e7d72b6e18cc79cea080b564df5fd1d50f3f (diff) | |
| download | rockbox-fb067481a8d2ec5c890fab5860ab246d019eecc9.zip rockbox-fb067481a8d2ec5c890fab5860ab246d019eecc9.tar.gz rockbox-fb067481a8d2ec5c890fab5860ab246d019eecc9.tar.bz2 rockbox-fb067481a8d2ec5c890fab5860ab246d019eecc9.tar.xz | |
Runtime display bug fix by Craig Sather (patch #766552)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3974 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/debug_menu.c | 12 | ||||
| -rw-r--r-- | apps/settings.c | 2 | ||||
| -rw-r--r-- | apps/settings.h | 1 | ||||
| -rw-r--r-- | apps/status.c | 6 |
4 files changed, 18 insertions, 3 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index f27bbac..a2cda98 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -1148,6 +1148,16 @@ static bool view_runtime(void) #endif if (state & 1) { + if (charger_inserted()) + { + global_settings.runtime = 0; + } + else + { + global_settings.runtime += ((current_tick - lasttime) / HZ); + } + lasttime = current_tick; + t = global_settings.runtime; lcd_puts(0, y++, "Current time"); } @@ -1162,7 +1172,7 @@ static bool view_runtime(void) lcd_update(); /* Wait for a key to be pushed */ - key = button_get_w_tmo(HZ*5); + key = button_get_w_tmo(HZ); switch(key) { #ifdef HAVE_PLAYER_KEYPAD case BUTTON_STOP | BUTTON_REL: diff --git a/apps/settings.c b/apps/settings.c index 15d1103..e31a2d4 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -151,6 +151,7 @@ Rest of config block, only saved to disk: *************************************/ #include "rtc.h" +long lasttime = 0; static unsigned char config_block[CONFIG_BLOCK_SIZE]; /* @@ -372,7 +373,6 @@ int settings_save( void ) ((global_settings.trickle_charge & 1) << 4)); { - static long lasttime = 0; int elapsed_secs; elapsed_secs = (current_tick - lasttime) / HZ; diff --git a/apps/settings.h b/apps/settings.h index 9f857e7..c3772ad 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -201,6 +201,7 @@ extern struct user_settings global_settings; /* name of directory where configuration, fonts and other data * files are stored */ extern char rockboxdir[]; +extern long lasttime; /* system defines */ diff --git a/apps/status.c b/apps/status.c index 7217568..6f412d8 100644 --- a/apps/status.c +++ b/apps/status.c @@ -137,12 +137,16 @@ void status_draw(bool force_redraw) plug_state = true; #ifdef HAVE_CHARGE_CTRL /* zero battery run time if charging */ - if (charge_state > 0) + if (charge_state > 0) { global_settings.runtime = 0; + lasttime = current_tick; + } /* animate battery if charging */ if (charge_state == 1) { #else + global_settings.runtime = 0; + lasttime = current_tick; { #endif /* animate in three steps (34% per step for a better look) */ |