diff options
author | Brandon Low <lostlogic@rockbox.org> | 2006-03-02 13:37:51 +0000 |
---|---|---|
committer | Brandon Low <lostlogic@rockbox.org> | 2006-03-02 13:37:51 +0000 |
commit | 6d19a569be771c0ebe1f0adcdf28927bfff5681d (patch) | |
tree | b024e3501b62df5b27c5189a575a536b9c708324 /apps/gui | |
parent | 8d0a32eb4b4fd7108b9ebae81f93b3909c3e477f (diff) | |
download | rockbox-6d19a569be771c0ebe1f0adcdf28927bfff5681d.tar.gz rockbox-6d19a569be771c0ebe1f0adcdf28927bfff5681d.zip |
Improved battery status reporting for units which support usb power / charge
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8886 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/statusbar.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c index 34ac5283af..8acfd1ca7f 100644 --- a/apps/gui/statusbar.c +++ b/apps/gui/statusbar.c | |||
@@ -185,7 +185,6 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | |||
185 | CONFIG_BATTERY == BATT_LIION2200 | 185 | CONFIG_BATTERY == BATT_LIION2200 |
186 | /* zero battery run time if charging */ | 186 | /* zero battery run time if charging */ |
187 | if (charge_state > DISCHARGING) { | 187 | if (charge_state > DISCHARGING) { |
188 | global_settings.runtime = 0; | ||
189 | lasttime = current_tick; | 188 | lasttime = current_tick; |
190 | } | 189 | } |
191 | 190 | ||
@@ -196,7 +195,6 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | |||
196 | #endif | 195 | #endif |
197 | ) { | 196 | ) { |
198 | #else | 197 | #else |
199 | global_settings.runtime = 0; | ||
200 | lasttime = current_tick; | 198 | lasttime = current_tick; |
201 | { | 199 | { |
202 | #endif | 200 | #endif |
@@ -227,19 +225,20 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | |||
227 | #ifdef HAVE_LCD_BITMAP | 225 | #ifdef HAVE_LCD_BITMAP |
228 | if (battery_state) | 226 | if (battery_state) |
229 | gui_statusbar_icon_battery(display, bar->info.battlevel); | 227 | gui_statusbar_icon_battery(display, bar->info.battlevel); |
230 | /* draw power plug if charging */ | ||
231 | if (bar->info.inserted) | ||
232 | display->mono_bitmap(bitmap_icons_7x8[Icon_Plug], | ||
233 | STATUSBAR_PLUG_X_POS, | ||
234 | STATUSBAR_Y_POS, STATUSBAR_PLUG_WIDTH, | ||
235 | STATUSBAR_HEIGHT); | ||
236 | #ifdef HAVE_USB_POWER | 228 | #ifdef HAVE_USB_POWER |
237 | else if (bar->info.usb_power) | 229 | if (bar->info.usb_power) |
238 | display->mono_bitmap(bitmap_icons_7x8[Icon_USBPlug], | 230 | display->mono_bitmap(bitmap_icons_7x8[Icon_USBPlug], |
239 | STATUSBAR_PLUG_X_POS, | 231 | STATUSBAR_PLUG_X_POS, |
240 | STATUSBAR_Y_POS, STATUSBAR_PLUG_WIDTH, | 232 | STATUSBAR_Y_POS, STATUSBAR_PLUG_WIDTH, |
241 | STATUSBAR_HEIGHT); | 233 | STATUSBAR_HEIGHT); |
234 | else | ||
242 | #endif /* HAVE_USB_POWER */ | 235 | #endif /* HAVE_USB_POWER */ |
236 | /* draw power plug if charging */ | ||
237 | if (bar->info.inserted) | ||
238 | display->mono_bitmap(bitmap_icons_7x8[Icon_Plug], | ||
239 | STATUSBAR_PLUG_X_POS, | ||
240 | STATUSBAR_Y_POS, STATUSBAR_PLUG_WIDTH, | ||
241 | STATUSBAR_HEIGHT); | ||
243 | 242 | ||
244 | bar->info.redraw_volume = gui_statusbar_icon_volume(bar, | 243 | bar->info.redraw_volume = gui_statusbar_icon_volume(bar, |
245 | bar->info.volume); | 244 | bar->info.volume); |