From d892214d88ed00344516a9b2f1a127c033d4618f Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sun, 25 May 2008 01:38:08 +0000 Subject: Gigabeat S: Add charge current and battery temp readout in power management and display in the battery screen. Thermistor data was obtained experimentally from one pulled off a dead board and appears basically correct when read back on a working device (which requires letting it settle to ambient temperature - a long wait so not easy to do). Sending me more thermistors would help improve accuracy *fingers crossed that it's close enough*. :-) This commit does NOT add charging but is a step towards implementing it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17626 a1c6a512-1295-4272-9138-f99709370657 --- apps/debug_menu.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'apps/debug_menu.c') diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 313a2aacac..22b1777a68 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -18,6 +18,7 @@ ****************************************************************************/ #include "config.h" +#include #include #include #include @@ -1649,7 +1650,18 @@ static bool view_battery(void) snprintf(buf, 30, "Charger: %s", charger_inserted() ? "present" : "absent"); lcd_puts(0, 3, buf); -#endif +#if defined TOSHIBA_GIGABEAT_S + y = battery_adc_charge_current(); + x = y < 0 ? '-' : ' '; + y = abs(y); + snprintf(buf, 30, "I Charge:%c%d.%03d A", (char)x, y / 1000, y % 1000); + lcd_puts(0, 4, buf); + + y = battery_adc_temp(); + snprintf(buf, 30, "T Battery: %dC (%dF)", y, (9*y + 160) / 5); + lcd_puts(0, 5, buf); +#endif /* defined TOSHIBA_GIGABEAT_S */ +#endif /* defined IPOD_NANO || defined IPOD_VIDEO */ #endif /* CONFIG_CHARGING != CHARGING_CONTROL */ #endif /* CONFIG_CHARGING */ break; -- cgit v1.2.3