StopWatch: add persistence
This PR solves Issue #303 and is based on previous work by @desttinghim (PR #783 ) and @pptime02 (PR #1410 ). Well, it's actually just a re-base of #1410 onto the current main branch. I did my best not to disrupt functionality implemented on main in the past 2 years. Any feedback is appreciated.
Build size and comparison to main:
| Section | Size | Difference |
|---|---|---|
| text | 380724B | 640B |
| data | 944B | 0B |
| bss | 22608B | 64B |
@FintasticMan Can you trigger CI?
Added a fix for a minor issue: after exiting StopWatch in the Paused state and then reopening it, the displayed time would shift by 4, sometimes 5 hundredths of a second. I think this is the delta between the last rendering and the moment we switch state to Paused and set timeElapsedPreviously. (The delta is consistent with the ~24 Hz refresh frequency I've observed.) The fix simply renders time once more once we are Paused.
By the way, I've noticed this PR breaks InfiniSim. Does that have to be adapted before things get merged in InfiniTime? I don't mind looking into it, it's just that the build setup seems a bit more involved (I went with the Docker method for InfinTime and that's super smooth).
Yeah it's good practice to get an InfiniSim PR up and waiting if a PR here will break it (annoyingly the CI has given up again so I can't easily see). I haven't used the docker method so I can't comment on that but provided you're on Linux getting a build environment up and running shouldn't be too bad.
I've created PR #163 for InfiniSim. Necessary changes were trivial. Functionality in InfiniSim seems to work as intended.
Great :)
Looking superb. Just needs a rebase for CI to run (and the last few bits of feedback) and then it's all good from me
I'm not sure how much I like the feel of the time being pushed right to the top? But that's probably just me being used to how it was before, so I'll see after living with it for a bit 👍
Regarding vertical positioning of the time label, my thinking goes like this:
- the top margin is about half as wide as the side margins - not good
- on PineTime, the margin blends with the watch bezel so it's OK - good
- there's too much empty room above the buttons when no laps are listed - not good
- there's enough room to list 3 laps - good
It would be nice if the time was vertically centered between the top and the buttons and then floated upwards as laps get added to the list, eventually ending up where it is now. I don't find the slight improvement worth the effort, though.