summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/sandisk/sansa-c200/powermgmt-c200.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2009-01-11 10:07:22 +0000
committerMichael Sevakis <jethead71@rockbox.org>2009-01-11 10:07:22 +0000
commit7d7969114da36a99afc4d80576ff9b089cb09e50 (patch)
tree48c3c574e382d80454c28a6b77de64a64f3cedcd /firmware/target/arm/sandisk/sansa-c200/powermgmt-c200.c
parentb84fe020a5bc497cee9b88eb782c2d4a9b7be711 (diff)
downloadrockbox-7d7969114da36a99afc4d80576ff9b089cb09e50.tar.gz
rockbox-7d7969114da36a99afc4d80576ff9b089cb09e50.tar.bz2
rockbox-7d7969114da36a99afc4d80576ff9b089cb09e50.zip
c200v1/e200v1: Add battery charging. This should be usable on v2 players but those should be evaluated for current, endpoint voltage and whether or not accurate battery readings may always be obtained (which determines algorithm setup and behavior).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19748 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/sandisk/sansa-c200/powermgmt-c200.c')
-rw-r--r--firmware/target/arm/sandisk/sansa-c200/powermgmt-c200.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/firmware/target/arm/sandisk/sansa-c200/powermgmt-c200.c b/firmware/target/arm/sandisk/sansa-c200/powermgmt-c200.c
index 963e7218de..9d7a0e2965 100644
--- a/firmware/target/arm/sandisk/sansa-c200/powermgmt-c200.c
+++ b/firmware/target/arm/sandisk/sansa-c200/powermgmt-c200.c
@@ -38,8 +38,8 @@ const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
{
+ /* NOTE: why is the top voltage 4237? That's just too high. */
{ 3286, 3679, 3734, 3764, 3788, 3824, 3886, 3950, 4014, 4098, 4237 },
-
};
/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
@@ -48,14 +48,3 @@ const unsigned short percent_to_volt_charge[11] =
/* Sansa c200 has a 530 mAh LiPo battery */
3300, 3390, 3480, 3570, 3660, 3750, 3840, 3930, 4020, 4110, 4200
};
-
-/* ADC should read 0x3ff=5.12V */
-#define BATTERY_SCALE_FACTOR 5125
-/* full-scale ADC readout (2^10) in millivolt */
-
-/* Returns battery voltage from ADC [millivolts] */
-unsigned int battery_adc_voltage(void)
-{
- return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10;
-}
-