Page 1 of 1

Is gpio_intr_enable() safe to call from ISR?

Posted: Wed Jul 30, 2025 2:33 pm
by dalbert
The documentation shows that it is safe to call gpio_intr_disable() from an ISR if CONFIG_GPIO_CTRL_FUNC_IN_IRAM is enabled, but does not have the same note for gpio_intr_enable(). I see no difference in their code and haven't seen any issues when using it, but I'd like to be sure. Does anyone know?

https://docs.espressif.com/projects/esp ... gpio_num_t

Re: Is gpio_intr_enable() safe to call from ISR?

Posted: Wed Jul 30, 2025 3:36 pm
by boarchuz
No. Only a few GPIO functions are placed in IRAM, and gpio_intr_enable is not one of them:
https://github.com/espressif/esp-idf/bl ... r.lf#L4-L7

Re: Is gpio_intr_enable() safe to call from ISR?

Posted: Thu Jul 31, 2025 7:24 am
by MicroController
Being placed in IRAM is not a precondition for a function to be usable from an ISR though...