forked from len0rd/rockbox
for FM and V2: removed the now false voltage reading from charging screen.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4096 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
44298163ba
commit
eb28d43cd7
3 changed files with 21 additions and 8 deletions
|
|
@ -140,17 +140,24 @@ void charging_display_info(bool animate)
|
||||||
const int pox_y = 32;
|
const int pox_y = 32;
|
||||||
static unsigned phase = 3;
|
static unsigned phase = 3;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
int battery_voltage;
|
|
||||||
int batt_int, batt_frac;
|
|
||||||
char buf[32];
|
char buf[32];
|
||||||
|
(void)buf;
|
||||||
|
|
||||||
battery_voltage = (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) / 10000;
|
#ifdef NEED_ATA_POWER_BATT_MEASURE
|
||||||
batt_int = battery_voltage / 100;
|
if (ide_powered()) /* FM and V2 can only measure when ATA power is on */
|
||||||
batt_frac = battery_voltage % 100;
|
#endif
|
||||||
|
{
|
||||||
|
int battery_voltage;
|
||||||
|
int batt_int, batt_frac;
|
||||||
|
|
||||||
snprintf(buf, 32, " Batt: %d.%02dV %d%% ", batt_int, batt_frac,
|
battery_voltage = (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) / 10000;
|
||||||
battery_level());
|
batt_int = battery_voltage / 100;
|
||||||
lcd_puts(0, 7, buf);
|
batt_frac = battery_voltage % 100;
|
||||||
|
|
||||||
|
snprintf(buf, 32, " Batt: %d.%02dV %d%% ", batt_int, batt_frac,
|
||||||
|
battery_level());
|
||||||
|
lcd_puts(0, 7, buf);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_CHARGE_CTRL
|
#ifdef HAVE_CHARGE_CTRL
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,9 @@
|
||||||
/* Define this if you need to power on ATA */
|
/* Define this if you need to power on ATA */
|
||||||
#define NEEDS_ATA_POWER_ON
|
#define NEEDS_ATA_POWER_ON
|
||||||
|
|
||||||
|
/* Define this if battery voltage can only be measured with ATA powered */
|
||||||
|
#define NEED_ATA_POWER_BATT_MEASURE
|
||||||
|
|
||||||
/* Define this to the CPU frequency */
|
/* Define this to the CPU frequency */
|
||||||
#define CPU_FREQ 11059200
|
#define CPU_FREQ 11059200
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,9 @@
|
||||||
/* Define this if you need to power on ATA */
|
/* Define this if you need to power on ATA */
|
||||||
#define NEEDS_ATA_POWER_ON
|
#define NEEDS_ATA_POWER_ON
|
||||||
|
|
||||||
|
/* Define this if battery voltage can only be measured with ATA powered */
|
||||||
|
#define NEED_ATA_POWER_BATT_MEASURE
|
||||||
|
|
||||||
/* Define this to the CPU frequency */
|
/* Define this to the CPU frequency */
|
||||||
#define CPU_FREQ 11059200
|
#define CPU_FREQ 11059200
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue