Interrupt and gpio processing improved