Added IRQ protection, arduino and Teensy3.x

Not tested but should work