summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/statusbar.c12
-rw-r--r--apps/gui/statusbar.h9
2 files changed, 14 insertions, 7 deletions
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c
index bbf01ab..043fbd3 100644
--- a/apps/gui/statusbar.c
+++ b/apps/gui/statusbar.c
@@ -157,6 +157,10 @@ static void gui_statusbar_init(struct gui_statusbar * bar)
{
bar->redraw_volume = true;
bar->volume_icon_switch_tick = bar->battery_icon_switch_tick = current_tick;
+ memset((void*)&(bar->lastinfo), 0, sizeof(struct status_info));
+#if CONFIG_RTC
+ bar->last_tm_min = 0;
+#endif
}
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)
bar->info.led = led_read(HZ/2); /* delay should match polling interval */
#endif
#if CONFIG_RTC
- bar->info.time = get_time();
+ bar->time = get_time();
#endif /* CONFIG_RTC */
/* only redraw if forced to, or info has changed */
if (force_redraw || bar->redraw_volume ||
+#if CONFIG_RTC
+ (bar->time->tm_min != bar->last_tm_min) ||
+#endif
memcmp(&(bar->info), &(bar->lastinfo), sizeof(struct status_info)))
{
display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
@@ -313,7 +320,8 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
gui_statusbar_icon_lock_remote(display);
#endif
#if CONFIG_RTC
- gui_statusbar_time(display, bar->info.time);
+ gui_statusbar_time(display, bar->time);
+ bar->last_tm_min = bar->time->tm_min;
#endif /* CONFIG_RTC */
#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
if(!display->has_disk_led && bar->info.led)
diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h
index 2be765b..8862620 100644
--- a/apps/gui/statusbar.h
+++ b/apps/gui/statusbar.h
@@ -33,10 +33,6 @@ struct status_info {
int volume;
int playmode;
int repeat;
-#if CONFIG_RTC
- struct tm *time;
-#endif
-
#if CONFIG_CHARGING
bool inserted;
#endif
@@ -65,7 +61,10 @@ struct gui_statusbar
struct status_info info;
struct status_info lastinfo;
-
+#if CONFIG_RTC
+ struct tm *time;
+ int last_tm_min;
+#endif
struct screen * display;
};