From 20caff2fbf6e9492ea35ce74ecda9cd43bcba431 Mon Sep 17 00:00:00 2001 From: Jörg Hohensohn Date: Sat, 19 Jul 2003 21:43:12 +0000 Subject: 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 --- apps/screens.c | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/apps/screens.c b/apps/screens.c index 93713b0587..4e2a5a8594 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -121,12 +121,18 @@ void usb_screen(void) } +/* some simulator dummies */ +#ifdef SIMULATOR +#define BATTERY_SCALE_FACTOR 7000 +#endif + + #ifdef HAVE_LCD_BITMAP void charging_display_info(bool animate) { unsigned char charging_logo[36]; const int pox_x = (LCD_WIDTH - sizeof(charging_logo)) / 2; - const int pox_y = 24; + const int pox_y = 32; static unsigned phase = 3; unsigned i; int battery_voltage; @@ -139,13 +145,32 @@ void charging_display_info(bool animate) snprintf(buf, 32, " Batt: %d.%02dV %d%% ", batt_int, batt_frac, battery_level()); - lcd_puts(0, 6, buf); + lcd_puts(0, 7, buf); #ifdef HAVE_CHARGE_CTRL - snprintf(buf, 30, " Charging: %s", charger_enabled ? "yes" : "no"); + + snprintf(buf, 32, "Charge mode:"); 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; + } #endif @@ -185,9 +210,10 @@ void charging_display_info(bool animate) } lcd_update(); } -#else +#else /* not HAVE_LCD_BITMAP */ void charging_display_info(bool animate) { + /* ToDo for Player */ (void)animate; } #endif @@ -210,8 +236,8 @@ int charging_screen(void) ide_power_enable(false); /* power down the disk, else would be spinning */ - backlight_on(); lcd_clear_display(); + backlight_on(); status_draw(true); #ifdef HAVE_LCD_BITMAP @@ -221,8 +247,6 @@ int charging_screen(void) lcd_puts(0, 1, "[charging]"); #endif - charger_enable(true); - do { status_draw(false); -- cgit v1.2.3