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.
This should not be merged, but serves to document and reproduce an odd bug that I am seeing locally.
Context
I was working on a major revision of the port subsystem, and was running into issues with etimers and polling processes.
After some time, I was able to boil it down to a very small example that also builds from the current master branch. This makes it seem independent from the current work (which is not submitted here).
To reproduce
Build either of the two commits from this PR. If everything is working, you should see
Hello World
printed in Pybricks Code every second after connecting.ev
check, it doesn't work at first but it starts when kicked externally. For example, start the REPL (state changes trigger a event broadcast).Caveats
This may be due to unrelated undefined behavior somewhere else. It seems to vary from build to build. At one point, adding comments made it (dis)appear, presumably because that changes the LC value of the switches. Similarly, experimenting with variations of
etimer_set
such asetimer_reset
don't make the difference, even if they sometimes appear to make it work, but presumably that is the same as above.This is one reason to create the CI build --- to see if it reproduces there too. EDIT: It does. I suppose that is a good thing.