summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2007-07-05 23:20:58 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2007-07-05 23:20:58 +0000
commit16b67e5812e8b6d5425864655c2825512709b538 (patch)
tree8ab91adfb9e0f55f1531e86bd1aab056b11d5c63
parent9b20dfd88f8b1e0b44977bb6db847f15487cdbb9 (diff)
downloadrockbox-16b67e5812e8b6d5425864655c2825512709b538.zip
rockbox-16b67e5812e8b6d5425864655c2825512709b538.tar.gz
rockbox-16b67e5812e8b6d5425864655c2825512709b538.tar.bz2
rockbox-16b67e5812e8b6d5425864655c2825512709b538.tar.xz
Make sure statusbar is updated when time changes. Fixes FS #7388. Moved time variable around and added init of info struct.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13802 a1c6a512-1295-4272-9138-f99709370657
-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;
};