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>
This commit is contained in:
parent
190577ee9d
commit
2ca6fe1a77
1 changed files with 13 additions and 3 deletions
10
apps/plugins/stopwatch.c
Normal file → Executable file
10
apps/plugins/stopwatch.c
Normal file → Executable file
|
@ -539,9 +539,19 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
|
||||
/* Lap timer */
|
||||
case STOPWATCH_LAP_TIMER:
|
||||
/*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 */
|
||||
|
|
Loading…
Reference in a new issue