summaryrefslogtreecommitdiff
path: root/apps/screens.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/screens.c')
-rw-r--r--apps/screens.c40
1 files 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)
121} 121}
122 122
123 123
124/* some simulator dummies */
125#ifdef SIMULATOR
126#define BATTERY_SCALE_FACTOR 7000
127#endif
128
129
124#ifdef HAVE_LCD_BITMAP 130#ifdef HAVE_LCD_BITMAP
125void charging_display_info(bool animate) 131void charging_display_info(bool animate)
126{ 132{
127 unsigned char charging_logo[36]; 133 unsigned char charging_logo[36];
128 const int pox_x = (LCD_WIDTH - sizeof(charging_logo)) / 2; 134 const int pox_x = (LCD_WIDTH - sizeof(charging_logo)) / 2;
129 const int pox_y = 24; 135 const int pox_y = 32;
130 static unsigned phase = 3; 136 static unsigned phase = 3;
131 unsigned i; 137 unsigned i;
132 int battery_voltage; 138 int battery_voltage;
@@ -139,13 +145,32 @@ void charging_display_info(bool animate)
139 145
140 snprintf(buf, 32, " Batt: %d.%02dV %d%% ", batt_int, batt_frac, 146 snprintf(buf, 32, " Batt: %d.%02dV %d%% ", batt_int, batt_frac,
141 battery_level()); 147 battery_level());
142 lcd_puts(0, 6, buf); 148 lcd_puts(0, 7, buf);
143 149
144#ifdef HAVE_CHARGE_CTRL 150#ifdef HAVE_CHARGE_CTRL
145 snprintf(buf, 30, " Charging: %s", charger_enabled ? "yes" : "no"); 151
152 snprintf(buf, 32, "Charge mode:");
146 lcd_puts(0, 2, buf); 153 lcd_puts(0, 2, buf);
147 if (!charger_enabled) 154
155 if (charge_state == 1)
156 snprintf(buf, 32, str(LANG_BATTERY_CHARGE));
157 else if (charge_state == 2)
158 snprintf(buf, 32, str(LANG_BATTERY_TOPOFF_CHARGE));
159 else if (charge_state == 3)
160 snprintf(buf, 32, str(LANG_BATTERY_TRICKLE_CHARGE));
161 else
162 snprintf(buf, 32, "not charging");
163
164 lcd_puts(0, 3, buf);
165 if (charger_enabled)
166 {
167 backlight_on(); /* using the light gives good indication */
168 }
169 else
170 {
171 backlight_off();
148 animate = false; 172 animate = false;
173 }
149#endif 174#endif
150 175
151 176
@@ -185,9 +210,10 @@ void charging_display_info(bool animate)
185 } 210 }
186 lcd_update(); 211 lcd_update();
187} 212}
188#else 213#else /* not HAVE_LCD_BITMAP */
189void charging_display_info(bool animate) 214void charging_display_info(bool animate)
190{ 215{
216 /* ToDo for Player */
191 (void)animate; 217 (void)animate;
192} 218}
193#endif 219#endif
@@ -210,8 +236,8 @@ int charging_screen(void)
210 236
211 ide_power_enable(false); /* power down the disk, else would be spinning */ 237 ide_power_enable(false); /* power down the disk, else would be spinning */
212 238
213 backlight_on();
214 lcd_clear_display(); 239 lcd_clear_display();
240 backlight_on();
215 status_draw(true); 241 status_draw(true);
216 242
217#ifdef HAVE_LCD_BITMAP 243#ifdef HAVE_LCD_BITMAP
@@ -221,8 +247,6 @@ int charging_screen(void)
221 lcd_puts(0, 1, "[charging]"); 247 lcd_puts(0, 1, "[charging]");
222#endif 248#endif
223 249
224 charger_enable(true);
225
226 do 250 do
227 { 251 {
228 status_draw(false); 252 status_draw(false);