summaryrefslogtreecommitdiff
path: root/apps/plugins/stopwatch.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2004-12-03 07:36:11 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2004-12-03 07:36:11 +0000
commit059ada52d0784c31ec34e651b846e78134f93f61 (patch)
tree74cfb86af1ddbb596976784a73ab6697769a3961 /apps/plugins/stopwatch.c
parenta0d5bea9ec120cb19efedc95e8e96fe1ca88feff (diff)
downloadrockbox-059ada52d0784c31ec34e651b846e78134f93f61.zip
rockbox-059ada52d0784c31ec34e651b846e78134f93f61.tar.gz
rockbox-059ada52d0784c31ec34e651b846e78134f93f61.tar.bz2
rockbox-059ada52d0784c31ec34e651b846e78134f93f61.tar.xz
Make sure the time is updated before blocking in button_get()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5477 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/stopwatch.c')
-rw-r--r--apps/plugins/stopwatch.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/apps/plugins/stopwatch.c b/apps/plugins/stopwatch.c
index e21df0d..3843476 100644
--- a/apps/plugins/stopwatch.c
+++ b/apps/plugins/stopwatch.c
@@ -111,6 +111,41 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
while (!done)
{
+ if (counting)
+ {
+ stopwatch = prev_total + *rb->current_tick - start_at;
+ }
+ else
+ {
+ stopwatch = prev_total;
+ }
+
+ ticks_to_string(stopwatch,0,32,buf);
+ rb->lcd_puts(0, TIMER_Y, buf);
+
+ if(update_lap)
+ {
+ lap_start = curr_lap - lap_scroll;
+ for (lap = lap_start; lap > lap_start - LAP_LINES; lap--)
+ {
+ if (lap > 0)
+ {
+ ticks_to_string(lap_times[(lap-1)%MAX_LAPS],lap,32,buf);
+ rb->lcd_puts_scroll(0, LAP_Y + lap_start - lap, buf);
+ }
+ else
+ {
+ rb->lcd_puts(0, LAP_Y + lap_start - lap,
+ " ");
+ }
+ }
+ update_lap = false;
+ }
+
+#ifdef HAVE_LCD_BITMAP
+ rb->lcd_update();
+#endif
+
if (! counting)
{
button = rb->button_get(true);
@@ -187,41 +222,6 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
return PLUGIN_USB_CONNECTED;
break;
}
-
- if (counting)
- {
- stopwatch = prev_total + *rb->current_tick - start_at;
- }
- else
- {
- stopwatch = prev_total;
- }
-
- ticks_to_string(stopwatch,0,32,buf);
- rb->lcd_puts(0, TIMER_Y, buf);
-
- if(update_lap)
- {
- lap_start = curr_lap - lap_scroll;
- for (lap = lap_start; lap > lap_start - LAP_LINES; lap--)
- {
- if (lap > 0)
- {
- ticks_to_string(lap_times[(lap-1)%MAX_LAPS],lap,32,buf);
- rb->lcd_puts_scroll(0, LAP_Y + lap_start - lap, buf);
- }
- else
- {
- rb->lcd_puts(0, LAP_Y + lap_start - lap,
- " ");
- }
- }
- update_lap = false;
- }
-
-#ifdef HAVE_LCD_BITMAP
- rb->lcd_update();
-#endif
}
return PLUGIN_OK;
}