Skip to content

Conversation

@Riksu9000
Copy link
Contributor

@Riksu9000 Riksu9000 commented Jun 14, 2021

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.

@Avamander
Copy link
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.

@Riksu9000
Copy link
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.

@ObiKeahloa
Copy link
Contributor

Seems to be using an older base?

@JF002
Copy link
Collaborator

JF002 commented Jul 4, 2021

Looks good to me !
I agree with @Riksu9000 : The new code update what needs to be updated on response to an event instead of refreshing everything on each call to Refresh().

@JF002 JF002 added this to the Version 1.3 milestone Jul 4, 2021
@JF002 JF002 merged commit 61a4642 into InfiniTimeOrg:develop Jul 4, 2021
@Riksu9000 Riksu9000 deleted the improve_stopwatch branch July 30, 2022 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stopwatch improvements

4 participants