Added external interrupts handling