You say that you only change flag from the ISR and after you perform the task in the main program. This is a good thechnique but are you sure the following ISR will not change the flag before the main code of the previous has been executed?
You say that you only change flag from the ISR and after you perform the task in the main program. This is a good thechnique but are you sure the following ISR will not change the flag before the main code of the previous has been executed?