Yup, the code I tested above was yours, with my triggering code.
In regards to your previous comment, I have confirmed that the pin I’m using is the right one, and I’ve tried using a different one.
D1 drives a h-bridge at 40khz, sending an ultrasonic ping out of a transducer. This bounces off a wall and goes into another transducer. Then, I have a notch filter and a two stage amplifier that brings the recieved pulse to 3.3v amplitude so we can detect it on D3 digitally. DAC1 sets the threshold on a comparator on the receiver.