Skip to content
This repository has been archived by the owner on Nov 7, 2020. It is now read-only.

Fixes issue #16 #17

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix timer_restore_legacy when timer not running
We should only account for offset if the timer was running.
  • Loading branch information
ThiagoVinicius committed Apr 5, 2015
commit 13b92e5d7567d3f385cba4baa58bc6117d278cd4
4 changes: 3 additions & 1 deletion src/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ void timer_restore(Timer* timer, TimerTimestamp reference) {
void timer_restore_legacy(Timer* timer, TimerTimestamp reference, uint32_t offset, uint32_t display_time) {
uint32_t running_time = timer_display2running_time(timer, display_time);
timer_set_running_time(timer, reference, running_time);
timer_add_running_time(timer, offset);
if (TIMER_STATUS_RUNNING == timer->status) {
timer_add_running_time(timer, offset);
}
timer_restore(timer, reference);
}

Expand Down