Race conditions: To avoid
the possibility of missing a button press, the application code quickly sets
flags within the respective interrupt handler. This allows the processor to
get-in-get-out and minimize the time frame that another triggered interrupt
needs to be pending.
Debouncing: Debouncing of
the buttons can cause unintended interrupts to affect the way the application
code runs. To prevent this from happening, the interrupt is disabled inside of
the interrupt handler that is triggered. A timer is utilized to re-enable any
disabled interrupts about 10ms after entering the interrupt handler.