added interrupt handling to firmware