diff options
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/statusbar.c | 12 | ||||
-rw-r--r-- | apps/gui/statusbar.h | 9 |
2 files changed, 14 insertions, 7 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) |
diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h index 2be765b8e8..8862620596 100644 --- a/apps/gui/statusbar.h +++ b/apps/gui/statusbar.h | |||
@@ -33,10 +33,6 @@ struct status_info { | |||
33 | int volume; | 33 | int volume; |
34 | int playmode; | 34 | int playmode; |
35 | int repeat; | 35 | int repeat; |
36 | #if CONFIG_RTC | ||
37 | struct tm *time; | ||
38 | #endif | ||
39 | |||
40 | #if CONFIG_CHARGING | 36 | #if CONFIG_CHARGING |
41 | bool inserted; | 37 | bool inserted; |
42 | #endif | 38 | #endif |
@@ -65,7 +61,10 @@ struct gui_statusbar | |||
65 | 61 | ||
66 | struct status_info info; | 62 | struct status_info info; |
67 | struct status_info lastinfo; | 63 | struct status_info lastinfo; |
68 | 64 | #if CONFIG_RTC | |
65 | struct tm *time; | ||
66 | int last_tm_min; | ||
67 | #endif | ||
69 | struct screen * display; | 68 | struct screen * display; |
70 | }; | 69 | }; |
71 | 70 | ||