Confused by oscilloscope - square wave signal to RPM

You are doing quite a lot with interrupts being suspended. This cannot be correct.