From 2d0af6f3c7f1a33337ab5d9498364149104fd346 Mon Sep 17 00:00:00 2001 From: Torne Wuff Date: Tue, 3 Nov 2009 20:35:04 +0000 Subject: FS#9728: Battery current measuring on the Video iPod Patch by Boris Gjenero. Displays the current flowing into or out of the battery on the ipodvideo. Other ipods do not appear to have this ADC channel connected. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23500 a1c6a512-1295-4272-9138-f99709370657 --- apps/debug_menu.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'apps') diff --git a/apps/debug_menu.c b/apps/debug_menu.c index f9fb7a3bb7..4b80d81c55 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -1125,6 +1125,9 @@ bool dbg_ports(void) #ifdef ADC_ACCESSORY lcd_putsf(0, line++, "ACCESSORY: %d", adc_read(ADC_ACCESSORY)); #endif +#ifdef IPOD_VIDEO + lcd_putsf(0, line++, "4066_ISTAT: %d", adc_read(ADC_4066_ISTAT)); +#endif #if defined(IPOD_ACCESSORY_PROTOCOL) extern unsigned char serbuf[]; @@ -1529,6 +1532,16 @@ static bool view_battery(void) dock ? "enabled" : "disabled"); lcd_putsf(0, 7, "Headphone: %s", headphone ? "connected" : "disconnected"); +#ifdef IPOD_VIDEO + x = (adc_read(ADC_4066_ISTAT) * 2400) / +#if MEM == 64 + (1024 * 2); +#else + (1024 * 3); +#endif + lcd_putsf(0, 8, "Ibat: %d mA", x); + lcd_putsf(0, 9, "Vbat * Ibat: %d mW", x * y / 1000); +#endif #elif defined TOSHIBA_GIGABEAT_S int line = 3; unsigned int st; -- cgit v1.2.3