Got it working. Had to use https://github.com/jgautier/arduino-1/tree/pulseIn firmware