After interrupt PIR then Can I disable the interrupt after first to do interrupt process?.
Hi!
If I understood well, you want to disable interrupt right after motion interrupt is triggered to execute a time critical task.
If that’s the case, you need to insert the following line out of the setup() and out of the loop()
portMUX_TYPE mux portMUX_INITIALIZER_UNLOCKED
Then, on the handling interrupt function, you need to add the following line right at the beginning:
portENTER_CRITICAL_ISR
then, at the end of the function, you need to add the following line:
portEXIT_CRITICAL_ISR(&mux);
Note: I haven’t tested this, but I’ve seen many examples that use this method.
It may be easier to understand if you take a look at the example code on the following tutorial:
https://techtutorialsx.com/2017/09/30/esp32-arduino-external-interrupts/
I hope this helps,
Regards,
Sara