summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2003-11-19 14:14:41 +0000
committerBjörn Stenberg <bjorn@haxx.se>2003-11-19 14:14:41 +0000
commitf6b6db4167e0b133420138fb9ef94fdfa2e32a08 (patch)
treed2b99b7cb275a400bab0ae3b5d7a69bb35ed63d3 /apps
parentdb4bee4308ba88fdc0a3aa6b570c7782419a4b8d (diff)
downloadrockbox-f6b6db4167e0b133420138fb9ef94fdfa2e32a08.tar.gz
rockbox-f6b6db4167e0b133420138fb9ef94fdfa2e32a08.zip
Don't show battery meter until a proper power reading has been done
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4042 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/status.c4
-rw-r--r--apps/wps-display.c10
2 files changed, 10 insertions, 4 deletions
diff --git a/apps/status.c b/apps/status.c
index c6f4e4944c..7e9233a63f 100644
--- a/apps/status.c
+++ b/apps/status.c
@@ -175,8 +175,9 @@ void status_draw(bool force_redraw)
}
#ifdef HAVE_LCD_BITMAP
- if (battery_state)
+ if (battery_state && (info.battlevel > -1))
statusbar_icon_battery(info.battlevel, plug_state);
+
statusbar_icon_volume(info.volume);
statusbar_icon_play_state(current_mode + Icon_Play);
switch (info.repeat) {
@@ -202,6 +203,7 @@ void status_draw(bool force_redraw)
#if defined(HAVE_LCD_CHARCELLS)
+ if (info.battlevel > -1)
lcd_icon(ICON_BATTERY, battery_state);
lcd_icon(ICON_BATTERY_1, info.battlevel > 25);
lcd_icon(ICON_BATTERY_2, info.battlevel > 50);
diff --git a/apps/wps-display.c b/apps/wps-display.c
index c6621b1e62..563bb265be 100644
--- a/apps/wps-display.c
+++ b/apps/wps-display.c
@@ -478,10 +478,14 @@ static char* get_tag(struct mp3entry* id3,
return buf;
case 't': /* estimated battery time */
- snprintf(buf, buf_size, "%dh %dm",
- battery_time() / 60,
- battery_time() % 60);
+ {
+ int t = battery_time();
+ if (t >= 0)
+ snprintf(buf, buf_size, "%dh %dm", t / 60, t % 60);
+ else
+ strncpy(buf, "?h ?m", buf_size);
return buf;
+ }
}
break;