diff options
author | Michael Giacomelli <giac2000@hotmail.com> | 2012-06-13 22:22:34 -0400 |
---|---|---|
committer | Michael Giacomelli <mgiacomelli@gmail.com> | 2012-06-14 04:24:54 +0200 |
commit | 2ca6fe1a7700cdaf39805677c8cff05e3f022e00 (patch) | |
tree | de7caa2a9726fcdb032374e6386d18467a219341 | |
parent | 190577ee9d3b9c242231cf2e8797ebe5c02d160b (diff) | |
download | rockbox-2ca6fe1a7700cdaf39805677c8cff05e3f022e00.tar.gz rockbox-2ca6fe1a7700cdaf39805677c8cff05e3f022e00.zip |
Fix stop watch plugin from inserting 0 second laps if a new lap is started with the timer off.
Change-Id: I3d23d6dd47bb3b78a51d8a42b052403f7bf7665c
Reviewed-on: http://gerrit.rockbox.org/276
Reviewed-by: Michael Giacomelli <mgiacomelli@gmail.com>
Tested-by: Michael Giacomelli <mgiacomelli@gmail.com>
-rwxr-xr-x[-rw-r--r--] | apps/plugins/stopwatch.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/apps/plugins/stopwatch.c b/apps/plugins/stopwatch.c index 7a7828b3f3..49f633a2a9 100644..100755 --- a/apps/plugins/stopwatch.c +++ b/apps/plugins/stopwatch.c | |||
@@ -539,9 +539,19 @@ enum plugin_status plugin_start(const void* parameter) | |||
539 | 539 | ||
540 | /* Lap timer */ | 540 | /* Lap timer */ |
541 | case STOPWATCH_LAP_TIMER: | 541 | case STOPWATCH_LAP_TIMER: |
542 | lap_times[curr_lap%MAX_LAPS] = stopwatch; | 542 | /*check if we're timing, and start if not*/ |
543 | curr_lap++; | 543 | if (counting) |
544 | update_lap = true; | 544 | { |
545 | lap_times[curr_lap%MAX_LAPS] = stopwatch; | ||
546 | curr_lap++; | ||
547 | update_lap = true; | ||
548 | } | ||
549 | else | ||
550 | { | ||
551 | counting = ! counting; | ||
552 | start_at = *rb->current_tick; | ||
553 | stopwatch = prev_total + *rb->current_tick - start_at; | ||
554 | } | ||
545 | break; | 555 | break; |
546 | 556 | ||
547 | /* Scroll Lap timer up */ | 557 | /* Scroll Lap timer up */ |