Added code to support interrupt for the switches

Added code to support interrupt for the switches