Thanks to visit codestin.com
Credit goes to github.com

Skip to content

samd/mphalport: Run TinyUSB stack while waiting for CDC input/output. #12936

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

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

projectgus
Copy link
Contributor

See the commit a00c9d5 (#12926) for a detailed description of the problem, a regression introduced in 26d5032 (#12846).

Same approach here as the linked fix for rp2 (applied unconditionally here as this port only supports USB-CDC for stdin/stdout).

For test code I used the following:

from machine import Timer
import time


def print_lots(_):
    print(b"ABC" * 120)


t = Timer()
t.init(mode=Timer.ONE_SHOT, period=1000, callback=print_lots)
time.sleep(2)
print("Done!")

Only prints b and then hangs due to the regression, works again with this fix applied (prints the long bytes object, and then prints "Done!".)

See the commit a00c9d5 for a detailed description of the problem, a
regression introduced in 26d5032.

Same approach here as the linked fix for rp2 (applied unconditionally here
as this port only supports USB-CDC for stdin/stdout).

Signed-off-by: Angus Gratton <[email protected]>
@projectgus
Copy link
Contributor Author

@dpgeorge I missed yesterday that this fix would be needed on samd as well 🤦. Here's a quick patch.

@dpgeorge dpgeorge merged commit 033361d into micropython:master Nov 16, 2023
@dpgeorge
Copy link
Member

Thanks!

@projectgus projectgus deleted the bugfix/samd_blocking_cdc branch November 1, 2024 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants