-
Notifications
You must be signed in to change notification settings - Fork 1.3k
pressing Ctrl-C breaks time.sleep()
until reboot
#2865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is this on both nRF52840 and nRF52833? Please let us know what boards you've found this on. Thanks! |
I see this on Feather nRF52840. |
This is not just nRF. I see the same thing on Metro M0. |
time.sleep()
until reboottime.sleep()
until reboot
This broke somewhere between 3.1.2 and 4.1.2. |
Commit causing the issue is ea760c0: "Turn on MICROPY_OPT_COMPUTED_GOTO for 5x CPU-bound speedup". So probably there's something wrong with how When >>> time.sleep(100)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyboardInterrupt: In a bad build, you just see >>> time.sleep(100) # ctrl-c typed
>>> |
This problem does not occur in current micropython even when I compared our Really interestingly, this micropython commit, which is a minor speedup, micropython@869024d, changes
to
If I make that same change in our |
Aha: #1092 |
Issue #2865 -Clean up after ctrl-c interrupt in sleep
Description
Pressing
Ctrl-C
to interrupttime.sleep()
will causetime.sleep()
to instantaneously return on NRF until the board is reset.Steps to reproduce
In the REPL, run:
While it's sleeping, press Ctrl-C. The REPL will come back. Then run:
The REPL will return instantly.
Workaround
Performing a soft- or hard-reboot re-initializes the sleep timer and gets it working again.
The text was updated successfully, but these errors were encountered: