1
0
Fork 0
forked from len0rd/rockbox

m:robe 100 - remove ugly workaround for false initial voltage readings and wait until readings have settled instead

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16626 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Kukla 2008-03-11 09:38:12 +00:00
parent c194b388fa
commit 6a6c820f5f
2 changed files with 4 additions and 6 deletions

View file

@ -22,9 +22,6 @@
#include "adc.h"
#include "powermgmt.h"
/* FIXME: All voltages copied from H10/Tatung Elio. This will need changing
proper power management. */
const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
{
3450
@ -61,7 +58,5 @@ const unsigned short percent_to_volt_charge[11] =
/* Returns battery voltage from ADC [millivolts] */
unsigned int battery_adc_voltage(void)
{
/* work around the inital (false) high readout */
int readout=adc_read(ADC_UNREG_POWER);
return (readout>700) ? 3480 : (readout * BATTERY_SCALE_FACTOR) >> 10;
return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10;
}