After interrupt PIR then Can I disable the interrupt after first to do interrupt process?.
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:
then, at the end of the function, you need to add the following line:
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:
I hope this helps,