stopwatch bug
Closed this issue · 2 comments
fafa-junhe commented
I found a bug when I click the reset and continue buttons of the stopwatch at the same time, the time will increase unexpectedly.
if (hal->btnHasGoneDown(BUTTON_3)) {
if (reset) { // Start
start = hal->getLocalTime();
} else { // Continue
sumPaused += diff;
start = hal->getLocalTime();
}
running = true;
reset = false;
}
if (hal->btnHasGoneDown(BUTTON_2)) {
if (running) { // Stop
running = false;
} else { // Reset
diff = 0;
sumPaused = 0;
reset = true;
}
}
simonmicro commented
Should be fixed - could you confirm this with a fresh build from the develop
branch?
fafa-junhe commented
Yes - It fixes perfectly.