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 /apps/plugins | |
| parent | 190577ee9d3b9c242231cf2e8797ebe5c02d160b (diff) | |
| download | rockbox-2ca6fe1a7700cdaf39805677c8cff05e3f022e00.zip rockbox-2ca6fe1a7700cdaf39805677c8cff05e3f022e00.tar.gz rockbox-2ca6fe1a7700cdaf39805677c8cff05e3f022e00.tar.bz2 rockbox-2ca6fe1a7700cdaf39805677c8cff05e3f022e00.tar.xz | |
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>
Diffstat (limited to 'apps/plugins')
| -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 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 */ |