summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorTorne Wuff <torne@wolfpuppy.org.uk>2009-11-03 20:35:04 +0000
committerTorne Wuff <torne@wolfpuppy.org.uk>2009-11-03 20:35:04 +0000
commit2d0af6f3c7f1a33337ab5d9498364149104fd346 (patch)
tree84109df61eae758cf6368e9b1e4d52a205502541 /apps
parent9c343fab5dca19e89488170e8076f2b9f255151f (diff)
downloadrockbox-2d0af6f3c7f1a33337ab5d9498364149104fd346.tar.gz
rockbox-2d0af6f3c7f1a33337ab5d9498364149104fd346.zip
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
Diffstat (limited to 'apps')
-rw-r--r--apps/debug_menu.c13
1 files changed, 13 insertions, 0 deletions
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;