Is gpio_intr_enable() safe to call from ISR?

dalbert
Posts: 14
Joined: Wed Nov 16, 2016 3:45 am

Is gpio_intr_enable() safe to call from ISR?

Postby dalbert » Wed Jul 30, 2025 2:33 pm

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

boarchuz
Posts: 656
Joined: Tue Aug 21, 2018 5:28 am

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

Postby boarchuz » Wed Jul 30, 2025 3:36 pm

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

MicroController
Posts: 2661
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

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

Postby MicroController » Thu Jul 31, 2025 7:24 am

Being placed in IRAM is not a precondition for a function to be usable from an ISR though...

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 8 guests