← index #4214Issue #6581
Related · high · value 5.180
QUERY · ISSUE

ESP32 port missing "hard" kwarg in pin.irq()

openby jedieopened 2018-10-05updated 2025-01-07
enhancementport-esp32

The ESP8266 has hard keyword argument in pin.irq() function. This is missing in ESP32 port.

See also: https://forum.micropython.org/viewtopic.php?p=30748#p30745

CANDIDATE · ISSUE

docs: add section about interrupts to the quick reference (e.g. for ESP32)

openby solarjoeopened 2020-10-29updated 2025-10-03
docsport-esp32

I could not find the information that e.g. all interrupts on the ESP32 are soft interrupts and
the limitations about memory allocation mentioned at https://docs.micropython.org/en/latest/reference/isr_rules.html
are not relevant. This could be added to a section about interrupts in the Quickref.

Some text:

On ESP32 for example, all IRQs are "soft" which means they run in the MicroPython scheduler.
In general, the foo.irq(..., hard=) kwarg lets you control whether an IRQ is hard (runs in true interrupt context, no allocations) or soft (not very many restrictions). http://docs.micropython.org/en/latest/library/machine.Pin.html#machine.Pin.irq On ESP32 this kwarg is ignored because it must always be soft, but for example Pyboard/STM32 lets you use either.

from https://forum.micropython.org/viewtopic.php?f=2&t=9224#p51900

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