Details of os_delay_us function

dn_1983
Posts: 8
Joined: Mon Apr 07, 2025 7:41 am

Details of os_delay_us function

Postby dn_1983 » Thu Apr 17, 2025 7:44 am

Hello.

I am a newbie at ESP.

I can't find verbose information about os_delay_us function.

Could somebody advise me about these questions:

1. Are the interrupts enabled during this function?
2. What is the accuracy of this delay?

Thank you.

username
Posts: 593
Joined: Thu May 03, 2018 1:18 pm

Re: Details of os_delay_us function

Postby username » Sun Apr 20, 2025 8:35 pm

#include "esp_rom_sys.h"


esp_rom_delay_us(10); // Delay for 10 microseconds

Sprite
Espressif staff
Espressif staff
Posts: 10593
Joined: Thu Nov 26, 2015 4:08 am

Re: Details of os_delay_us function

Postby Sprite » Mon Apr 21, 2025 1:45 am

Also, interrupts are untouched in that routine (as in: if they were enabled before, they stay enabled during) and precision depends on if there is an interrupt or cache behaviour that takes away execution time. If that's not the case, it should be precise within a few CPU clock cycles.

dn_1983
Posts: 8
Joined: Mon Apr 07, 2025 7:41 am

Re: Details of os_delay_us function

Postby dn_1983 » Mon Apr 21, 2025 7:44 am

Thank you for clarification.

Who is online

Users browsing this forum: PerplexityBot and 1 guest