Improve stopwatch#432
Merged
JF002 merged 4 commits intoInfiniTimeOrg:developfrom Jul 4, 2021
Riksu9000:improve_stopwatch
Merged
Improve stopwatch#432JF002 merged 4 commits intoInfiniTimeOrg:developfrom Riksu9000:improve_stopwatch
JF002 merged 4 commits intoInfiniTimeOrg:developfrom
Riksu9000:improve_stopwatch
Conversation
Collaborator
|
Did you run Clang-Format on the new code? I'm also not sure getting rid of the state machine made the functionality clearer. |
Contributor
Author
|
The state machine was inside the Refresh loop, which means it kept setting eveything multiple times per second. Now changes are made only when a button is pressed, and I think it is much easier to see what pressing a button does, whereas before some of the changes were in the button function, and some somewhere in the state machine. Clang-format changes some lines so I'll commit that soon. |
Contributor
|
Seems to be using an older base? |
Collaborator
|
Looks good to me ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cleaned up the messy code.
While the stopwatch is running, sleep is disabled.
While the stopwatch is running, the button will stop the timer. In all other cases the button will exit the app.
Fixes #379?
EDIT: Forgot to mention that removing the Events code also improves the responsiveness of the app, since it no longer waits for a screen refresh cycle.