diff options
Diffstat (limited to 'apps/gui/statusbar.c')
-rw-r--r-- | apps/gui/statusbar.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c index bbf01abd7c..043fbd3e76 100644 --- a/apps/gui/statusbar.c +++ b/apps/gui/statusbar.c | |||
@@ -157,6 +157,10 @@ static void gui_statusbar_init(struct gui_statusbar * bar) | |||
157 | { | 157 | { |
158 | bar->redraw_volume = true; | 158 | bar->redraw_volume = true; |
159 | bar->volume_icon_switch_tick = bar->battery_icon_switch_tick = current_tick; | 159 | bar->volume_icon_switch_tick = bar->battery_icon_switch_tick = current_tick; |
160 | memset((void*)&(bar->lastinfo), 0, sizeof(struct status_info)); | ||
161 | #if CONFIG_RTC | ||
162 | bar->last_tm_min = 0; | ||
163 | #endif | ||
160 | } | 164 | } |
161 | 165 | ||
162 | void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | 166 | void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) |
@@ -239,11 +243,14 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | |||
239 | bar->info.led = led_read(HZ/2); /* delay should match polling interval */ | 243 | bar->info.led = led_read(HZ/2); /* delay should match polling interval */ |
240 | #endif | 244 | #endif |
241 | #if CONFIG_RTC | 245 | #if CONFIG_RTC |
242 | bar->info.time = get_time(); | 246 | bar->time = get_time(); |
243 | #endif /* CONFIG_RTC */ | 247 | #endif /* CONFIG_RTC */ |
244 | 248 | ||
245 | /* only redraw if forced to, or info has changed */ | 249 | /* only redraw if forced to, or info has changed */ |
246 | if (force_redraw || bar->redraw_volume || | 250 | if (force_redraw || bar->redraw_volume || |
251 | #if CONFIG_RTC | ||
252 | (bar->time->tm_min != bar->last_tm_min) || | ||
253 | #endif | ||
247 | memcmp(&(bar->info), &(bar->lastinfo), sizeof(struct status_info))) | 254 | memcmp(&(bar->info), &(bar->lastinfo), sizeof(struct status_info))) |
248 | { | 255 | { |
249 | display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | 256 | display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); |
@@ -313,7 +320,8 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | |||
313 | gui_statusbar_icon_lock_remote(display); | 320 | gui_statusbar_icon_lock_remote(display); |
314 | #endif | 321 | #endif |
315 | #if CONFIG_RTC | 322 | #if CONFIG_RTC |
316 | gui_statusbar_time(display, bar->info.time); | 323 | gui_statusbar_time(display, bar->time); |
324 | bar->last_tm_min = bar->time->tm_min; | ||
317 | #endif /* CONFIG_RTC */ | 325 | #endif /* CONFIG_RTC */ |
318 | #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) | 326 | #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) |
319 | if(!display->has_disk_led && bar->info.led) | 327 | if(!display->has_disk_led && bar->info.led) |