-
-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Labels
software: pybricks-micropythonIssues with Pybricks MicroPython firmware (or EV3 runtime)Issues with Pybricks MicroPython firmware (or EV3 runtime)
Description
Might have found something useful... 💡
I'm wondering if we've got a more generic memory corruption issue with stdin, which just happens to manifest itself as a lockup on Technic Hub. The following apparent memory corruption occurs on both Technic Hub and Prime Hub.
Neither hub freezes, so if this is the same issue, debugging should be easier. (Assuming it's not just a bad implementation of the color type).
EDIT: This is probably just the Color dict being garbage-collected, which is a separate issue. But it did lead to some additional insights with the freeze possibly coinciding with garbage collection. See posts below.
from pybricks.parameters import Color
from usys import stdin
from uselect import poll
p = poll()
p.register(stdin)
# Prints the whole color dictionary (good)
print(Color)
# Wait for one key press
while not p.poll(0):
pass
# Prints an empty dictionary (bad)
print(Color)Originally posted by @laurensvalk in #306 (comment)
Metadata
Metadata
Assignees
Labels
software: pybricks-micropythonIssues with Pybricks MicroPython firmware (or EV3 runtime)Issues with Pybricks MicroPython firmware (or EV3 runtime)