docs: BLE Event handling seems to contradict general guidelines for IRQ handling
Documentation URL
https://docs.micropython.org/en/latest/library/bluetooth.html#event-handling
Description
In BLE event handling a suggestion is given to create copies of the ringbuffer parameters. This however, would violate the general guidelines given for interrupt routines which specifically warn against instantiating objects.
https://github.com/micropython/micropython/blob/99ac8193ea299e6d836b076149f561e58226ede6/docs/reference/isr_rules.rst?plain=1#L102
Code of Conduct
Yes, I agree
docs: machine.UART.irq arguments are incorrect
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.