summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins')
-rwxr-xr-x[-rw-r--r--]apps/plugins/stopwatch.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/apps/plugins/stopwatch.c b/apps/plugins/stopwatch.c
index 7a7828b..49f633a 100644..100755
--- a/apps/plugins/stopwatch.c
+++ b/apps/plugins/stopwatch.c
@@ -539,9 +539,19 @@ enum plugin_status plugin_start(const void* parameter)
/* Lap timer */
case STOPWATCH_LAP_TIMER:
- lap_times[curr_lap%MAX_LAPS] = stopwatch;
- curr_lap++;
- update_lap = true;
+ /*check if we're timing, and start if not*/
+ if (counting)
+ {
+ lap_times[curr_lap%MAX_LAPS] = stopwatch;
+ curr_lap++;
+ update_lap = true;
+ }
+ else
+ {
+ counting = ! counting;
+ start_at = *rb->current_tick;
+ stopwatch = prev_total + *rb->current_tick - start_at;
+ }
break;
/* Scroll Lap timer up */