forked from len0rd/rockbox
doesn't mess with the charging (let algorithm decide), show charge phase as text, indicate current flow as animation and light, simulator fix
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3848 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
68125796b8
commit
20caff2fbf
1 changed files with 32 additions and 8 deletions
|
|
@ -121,12 +121,18 @@ void usb_screen(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* some simulator dummies */
|
||||||
|
#ifdef SIMULATOR
|
||||||
|
#define BATTERY_SCALE_FACTOR 7000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
void charging_display_info(bool animate)
|
void charging_display_info(bool animate)
|
||||||
{
|
{
|
||||||
unsigned char charging_logo[36];
|
unsigned char charging_logo[36];
|
||||||
const int pox_x = (LCD_WIDTH - sizeof(charging_logo)) / 2;
|
const int pox_x = (LCD_WIDTH - sizeof(charging_logo)) / 2;
|
||||||
const int pox_y = 24;
|
const int pox_y = 32;
|
||||||
static unsigned phase = 3;
|
static unsigned phase = 3;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
int battery_voltage;
|
int battery_voltage;
|
||||||
|
|
@ -139,13 +145,32 @@ void charging_display_info(bool animate)
|
||||||
|
|
||||||
snprintf(buf, 32, " Batt: %d.%02dV %d%% ", batt_int, batt_frac,
|
snprintf(buf, 32, " Batt: %d.%02dV %d%% ", batt_int, batt_frac,
|
||||||
battery_level());
|
battery_level());
|
||||||
lcd_puts(0, 6, buf);
|
lcd_puts(0, 7, buf);
|
||||||
|
|
||||||
#ifdef HAVE_CHARGE_CTRL
|
#ifdef HAVE_CHARGE_CTRL
|
||||||
snprintf(buf, 30, " Charging: %s", charger_enabled ? "yes" : "no");
|
|
||||||
|
snprintf(buf, 32, "Charge mode:");
|
||||||
lcd_puts(0, 2, buf);
|
lcd_puts(0, 2, buf);
|
||||||
if (!charger_enabled)
|
|
||||||
|
if (charge_state == 1)
|
||||||
|
snprintf(buf, 32, str(LANG_BATTERY_CHARGE));
|
||||||
|
else if (charge_state == 2)
|
||||||
|
snprintf(buf, 32, str(LANG_BATTERY_TOPOFF_CHARGE));
|
||||||
|
else if (charge_state == 3)
|
||||||
|
snprintf(buf, 32, str(LANG_BATTERY_TRICKLE_CHARGE));
|
||||||
|
else
|
||||||
|
snprintf(buf, 32, "not charging");
|
||||||
|
|
||||||
|
lcd_puts(0, 3, buf);
|
||||||
|
if (charger_enabled)
|
||||||
|
{
|
||||||
|
backlight_on(); /* using the light gives good indication */
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
backlight_off();
|
||||||
animate = false;
|
animate = false;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -185,9 +210,10 @@ void charging_display_info(bool animate)
|
||||||
}
|
}
|
||||||
lcd_update();
|
lcd_update();
|
||||||
}
|
}
|
||||||
#else
|
#else /* not HAVE_LCD_BITMAP */
|
||||||
void charging_display_info(bool animate)
|
void charging_display_info(bool animate)
|
||||||
{
|
{
|
||||||
|
/* ToDo for Player */
|
||||||
(void)animate;
|
(void)animate;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -210,8 +236,8 @@ int charging_screen(void)
|
||||||
|
|
||||||
ide_power_enable(false); /* power down the disk, else would be spinning */
|
ide_power_enable(false); /* power down the disk, else would be spinning */
|
||||||
|
|
||||||
backlight_on();
|
|
||||||
lcd_clear_display();
|
lcd_clear_display();
|
||||||
|
backlight_on();
|
||||||
status_draw(true);
|
status_draw(true);
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
|
@ -221,8 +247,6 @@ int charging_screen(void)
|
||||||
lcd_puts(0, 1, "[charging]");
|
lcd_puts(0, 1, "[charging]");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
charger_enable(true);
|
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
status_draw(false);
|
status_draw(false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue