summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2005-04-06 23:53:19 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2005-04-06 23:53:19 +0000
commit43bf39edb718aa510188b3594e583c905dea5a54 (patch)
tree0b548d7425f68214a64528cb7eae08e4f24a8fe3 /apps
parent09e55a921883ab7e71bce19c49adc07705b827f5 (diff)
downloadrockbox-43bf39edb718aa510188b3594e583c905dea5a54.tar.gz
rockbox-43bf39edb718aa510188b3594e583c905dea5a54.tar.bz2
rockbox-43bf39edb718aa510188b3594e583c905dea5a54.zip
First lame attempt to show correct battery level on the iRiver
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6258 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/debug_menu.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 2ab2194199..3969972ea8 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -825,6 +825,8 @@ bool dbg_ports(void)
char buf[128];
int button;
int line;
+ int battery_voltage;
+ int batt_int, batt_frac;
#ifdef HAVE_LCD_BITMAP
lcd_setmargins(0, 0);
@@ -873,6 +875,14 @@ bool dbg_ports(void)
snprintf(buf, sizeof(buf), "ADC_BATTERY: %02x", adc_battery);
lcd_puts(0, line++, buf);
+ battery_voltage = (adc_battery * BATTERY_SCALE_FACTOR) / 10000;
+ batt_int = battery_voltage / 100;
+ batt_frac = battery_voltage % 100;
+
+ snprintf(buf, 32, "Batt: %d.%02dV %d%% ", batt_int, batt_frac,
+ battery_level());
+ lcd_puts(0, line++, buf);
+
lcd_update();
button = button_get_w_tmo(HZ/10);