[p2] Simplify burn in LED blink, work around System.millis() reset #2491
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.
Problem
The P2 burn in process is supposed to indicate how long it has run by blinking the LED every 1s. An alternating green/blue pattern indicates the tests are still running and passing.
For burn in hours X:
x >= 72h : 6 green blinks 4 blue
72h > x >= 48h : 7 green blinks 3 blue
48h > x >= 24h : 8 green blinks, 2 blue
x < 24h : 9 green blinks, 1 blue
The current LED blink logic is convoluted, and relies on the
System.millis()
value monotonically increasing. Unfortunately there is also a bug right now where it resets sometimes, which causes the LED logic to break and stop blinking all together.Solution
Simplify LED blink logic. Just use
delay()
since LED loop has its own thread. No need to rely onSystem.millis()
Steps to Test
Build tinker, run burnin
Example App
Tinker
References
Links to the Community, Docs, Other Issues, etc..
Completeness