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

Skip to content

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