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

raspberrypi: Claim UART after checking pins #5834

Merged
merged 2 commits into from
Jan 12, 2022
Merged

Conversation

arturo182
Copy link
Collaborator

If, for some reason, you mix up TX and RX when calling busio.UART (who would do that ;) ), you get Invalid pins. When you go to try again, you'll get All UART peripherals are in use because the interface was claimed as busy before pins are verified. This should fix that issue.

If, for some reason, you mix up TX and RX when calling `busio.UART` (who would do that ;) ), you get `Invalid pins`. When you go to try again, you'll get `All UART peripherals are in use` because the interface was claimed as busy before pins are verified. This should fix that issue.
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.

One suggestion because I think we could leave inited pins if the UART is in use already as proposed.

ports/raspberrypi/common-hal/busio/UART.c Outdated Show resolved Hide resolved
Co-authored-by: Scott Shawcroft <scott@adafruit.com>
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.

Thank you!

@tannewt tannewt merged commit 46c0436 into main Jan 12, 2022
@arturo182 arturo182 deleted the rpi-uart-claim-later branch January 13, 2022 00:22
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.

2 participants