Inline the interrupt handler as a lambda since it's small.