// microseconds void bcm2835_delayMicroseconds(uint64_t micros) { struct timespec t1; uint64_t start; // Calling nanosleep() takes at least 100-200 us, so use it for // long waits and use a busy wait on the System Timer for the rest. start = bcm2835_st_read(); if (micros > 450) { t1.tv_sec = 0; t1.tv_nsec = 1000 * (long)(micros - 200); nanosleep(&t1, NULL); } bcm2835_st_delay(start, micros); }
//void bcm2835_st_delay(uint64_t offset_micros, uint64_t micros); /// Call bcm2835_st_delay with 2 parameters /// \par Refer /// \par Modify void ope_st_delay(void) { get_long_code(); get_long_code(); bcm2835_st_delay( *((uint64_t *)(buff+1)), *((uint64_t *)(buff+9)) ); }
void inline bcm2835_delayMicroseconds(unsigned long long micros) { bcm2835_st_delay(bcm2835_st_read(), micros); }