diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2008-05-25 01:38:08 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2008-05-25 01:38:08 +0000 |
commit | d892214d88ed00344516a9b2f1a127c033d4618f (patch) | |
tree | 6558e0e53d770a5984f7b775945a09ff948c1c7d /apps/debug_menu.c | |
parent | 11a667b6ca68e9e9e1025319cd5bdffd02e3a841 (diff) | |
download | rockbox-d892214d88ed00344516a9b2f1a127c033d4618f.tar.gz rockbox-d892214d88ed00344516a9b2f1a127c033d4618f.zip |
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
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r-- | apps/debug_menu.c | 14 |
1 files changed, 13 insertions, 1 deletions
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 @@ | |||
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | 19 | ||
20 | #include "config.h" | 20 | #include "config.h" |
21 | #include <stdlib.h> | ||
21 | #include <stdio.h> | 22 | #include <stdio.h> |
22 | #include <stdbool.h> | 23 | #include <stdbool.h> |
23 | #include <string.h> | 24 | #include <string.h> |
@@ -1649,7 +1650,18 @@ static bool view_battery(void) | |||
1649 | snprintf(buf, 30, "Charger: %s", | 1650 | snprintf(buf, 30, "Charger: %s", |
1650 | charger_inserted() ? "present" : "absent"); | 1651 | charger_inserted() ? "present" : "absent"); |
1651 | lcd_puts(0, 3, buf); | 1652 | lcd_puts(0, 3, buf); |
1652 | #endif | 1653 | #if defined TOSHIBA_GIGABEAT_S |
1654 | y = battery_adc_charge_current(); | ||
1655 | x = y < 0 ? '-' : ' '; | ||
1656 | y = abs(y); | ||
1657 | snprintf(buf, 30, "I Charge:%c%d.%03d A", (char)x, y / 1000, y % 1000); | ||
1658 | lcd_puts(0, 4, buf); | ||
1659 | |||
1660 | y = battery_adc_temp(); | ||
1661 | snprintf(buf, 30, "T Battery: %dC (%dF)", y, (9*y + 160) / 5); | ||
1662 | lcd_puts(0, 5, buf); | ||
1663 | #endif /* defined TOSHIBA_GIGABEAT_S */ | ||
1664 | #endif /* defined IPOD_NANO || defined IPOD_VIDEO */ | ||
1653 | #endif /* CONFIG_CHARGING != CHARGING_CONTROL */ | 1665 | #endif /* CONFIG_CHARGING != CHARGING_CONTROL */ |
1654 | #endif /* CONFIG_CHARGING */ | 1666 | #endif /* CONFIG_CHARGING */ |
1655 | break; | 1667 | break; |