We're making a height sensor with Bluetooth connectivity using a simple HC-SR04 ultrasonic module, which outputs the height as a pulse with certain width. The width of the pulse should be detected within 1 us, possibly even better. We're testing this on the PCA10001 development board.
We're using TIMER2 and GPIOTE interrupt handler to handle the pulse, measure the width an calculate the height. If the soft-device stack is not initialized, we're getting nice measurements with minimal difference. If the soft-device stack is initialized, the measurements are often way off, probably because of the higher priority of the soft-device.
What is the maximum delay caused by the soft-device before the GPIOTE_IRQHandler is ran? How can we minimize this delay (measure precise times)?