Skip to content

Commit

Permalink
Merge pull request #31 from futurexdesign/UI_CountDown_FIX
Browse files Browse the repository at this point in the history
Fix for issue #29 (timer roll-over displaying 58:47)
  • Loading branch information
futurexdesign committed Jun 2, 2023
2 parents 571a436 + b592bfd commit d143785
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/motorControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,10 @@ unsigned long MotorControl::getSecondsRemaining() {

unsigned long rtn = 0;
if (state.isRunning) {
rtn = (state.run_end - millis()) / 1000;
if(state.run_end > millis()) // Need to stop 'negative' result
rtn = ((state.run_end - millis()) / 1000);
else
rtn = 0;
}

return rtn;
Expand Down

0 comments on commit d143785

Please sign in to comment.