← index #16577Issue #14311
Off-topic · high · value 1.483
QUERY · ISSUE

docs: BLE Event handling seems to contradict general guidelines for IRQ handling

openby 32BTopened 2025-01-13updated 2025-11-06
docs

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

CANDIDATE · ISSUE

docs: machine.UART.irq arguments are incorrect

closedby AsensioLopened 2024-04-16updated 2024-04-17

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.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied