Hello,
Well, as you may understand, the interrupt process takes some time between, enter to the interrupt vector and execute the code, and you are trying to add some DELAY in the interrupt function, which it is not going to be correct, since during the delay another interrupt it is in the queue, to get process, so once the interrupt in the queue it is process you are not finish the last one, when you get the new one. That it is totally wrong you need to avoid this kind of behavior
the IRQ handlers, need to be short as possible just, move some flags, and in the main the toggle function based on the flags.
Have a great day,
Soledad
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------