Concept Flow - ISR best practices (keep it short)
Interrupt Occurs
Save Context
Execute ISR Quickly
Clear Interrupt Flag
Restore Context
Return to Main Program
When an interrupt happens, save the current state, run the ISR fast, clear the interrupt, restore state, then continue main code.