Skip to content
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

overflowed tick counter needs 64 bits everywhere #3939

Merged
merged 1 commit into from
Jan 7, 2021

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Jan 6, 2021

The 64-bit tick overflow counter was being truncated when copied, in certain cases.

This seems to fix #3919. It may also xxfix #3918, and perhaps xxfix #3912.

I still don't understand why this problem is showing up only in MacOS.

@dhalbert dhalbert requested a review from tannewt January 6, 2021 16:15
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thank you!

@dhalbert dhalbert marked this pull request as draft January 6, 2021 16:54
@dhalbert
Copy link
Collaborator Author

dhalbert commented Jan 6, 2021

There is some other bug as well, that is present in 6.1.0-beta.3. Sleep times are too long and inaccurate now. Sounds like #3912.

Adafruit CircuitPython 6.0.1 on 2020-12-28; Adafruit Feather M0 Express with samd21g18
>>> import time
>>> print(time.monotonic()); time.sleep(0.1); print(time.monotonic())
14.036
14.136

But beta.3 is bad;

Adafruit CircuitPython 6.1.0-beta.3 on 2020-12-31; Adafruit Metro M0 Express with samd21g18
>>> import time
>>> print(time.monotonic()); time.sleep(0.1); print(time.monotonic())
19.724
20.851

Even with this PR:

Adafruit CircuitPython 6.1.0-rc.0-dirty on 2021-01-06; Adafruit Metro M0 Express with samd21g18
>>> import time
>>> print(time.monotonic()); time.sleep(0.1); print(time.monotonic())
11.315
12.383

@dhalbert dhalbert marked this pull request as ready for review January 7, 2021 17:56
@dhalbert
Copy link
Collaborator Author

dhalbert commented Jan 7, 2021

I'm going to merge this fix now to fix #3919 and will backport it to 6.1.x before 6.1.0 final. We're still working on another sleep bug which is a second-order bug caused by a buffer overflow during a USB operation.

@dhalbert dhalbert merged commit 5358524 into adafruit:main Jan 7, 2021
@dhalbert dhalbert deleted the tick-overflow branch January 7, 2021 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SAMD21on MacOS: REPL prompt does not appear after ">>> time.sleep()"
2 participants