Delay Microseconds Function [SOLVED]

I was wondering if anyone could point me to the correct location of a delay microseconds function within the existing firmware. I’m working with a Photon and am trying to develop a 1-wire master with software for educational purposes. I need a reliable way to get timings in microseconds. I found the HAL_Delay_Microseconds in /hal/inc/delay_hal.h, but there doesn’t seem to be an implementation in /hal/src/photon/delay_hal.c and I’m not even sure if this is the correct function to use to begin with. Any help on the matter would be greatly appreciated.

@jfox, you can use the wiring function delayMicroseconds() or for non-blocking code, you can use micros(). Take a look at this topic about 2/3 down for inspiration if you need you own custom function:

That’s the correct function to use. The implementation is here:

1 Like