Skip to content

docs: machine.UART.irq arguments are incorrect #14311

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

Closed
2 tasks done
AsensioL opened this issue Apr 16, 2024 · 2 comments
Closed
2 tasks done

docs: machine.UART.irq arguments are incorrect #14311

AsensioL opened this issue Apr 16, 2024 · 2 comments

Comments

@AsensioL
Copy link
Contributor

Checks

  • I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.

  • I've searched for existing issues and didn't find any that matched.

Documentation URL

https://docs.micropython.org/en/latest/library/machine.UART.html

Description

The machine.UART.irq entry on the public docs has the following arguments:
UART.irq(trigger, priority=1, handler=None, wake=machine.IDLE)

However, looking at extmod/machine_uart.c, and in practice, machine.UART.irq behaves more like:
UART.irq(handler=None, trigger=0, hard=False).
Note that the position of handler is wrong, priority and wake should be removed and hard needs to be added.

I would like to update docs/library/machine.UART.rst to reflect the correct arguments.
But maybe other platforms handle machine.UART.irq differently, and I only use MicroPython on STM32 devices.

Please, let me know if that's the case and, if not, I'll proceed to fix and create a merge request.

@robert-hh
Copy link
Contributor

Thank you for the report. There are already two PRs open about this topic: #14040 and #14041. So this will be fixed.

@AsensioL
Copy link
Contributor Author

That work look great. I only searched on the issues section.
Closing this.

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

No branches or pull requests

2 participants