Hello
I want to find the source code (Not the header file) for the esp_timer_get_time() function.
I am using Arduino IDE to program ESP32. I searched for this function in entire ESP32 core folder, but only found the esp_timer.h file which only have the definition. Please give me a reference to find the source code.
Is it OK to use esp_timer_get_time() function in multiple tasks/cores without any mutual exclusion?.
Thank you
Finding source code for esp_timer_get_time()
-
- Posts: 13
- Joined: Thu Jul 30, 2020 2:40 pm
Re: Finding source code for esp_timer_get_time()
Hi, damithpavithra
I have not found its path on my Pc exactly.
It may be compiled into any (.a) file or something. Like here.https://github.com/espressif/esp-face/issues/29
But what I find is its open document. https://github.com/espressif/esp-idf/bl ... sp_timer.c
And funcions introduction.https://lang-ship.com/reference/ESP32/l ... 981faa2370
Hope it can help.
I have not found its path on my Pc exactly.
It may be compiled into any (.a) file or something. Like here.https://github.com/espressif/esp-face/issues/29
But what I find is its open document. https://github.com/espressif/esp-idf/bl ... sp_timer.c
And funcions introduction.https://lang-ship.com/reference/ESP32/l ... 981faa2370
Hope it can help.
-
- Posts: 13
- Joined: Thu Jul 30, 2020 2:40 pm
Re: Finding source code for esp_timer_get_time()
Hi GE_Rita
Thank you for the reply. Seems like they pre compiled those into .a files. Dont know why they do that.
It would be really helpful to debug and learn the device if there are uncompiled source files.
https://github.com/espressif/esp-idf/bl ... sp_timer.c only have three lines which uses the function output. Not its source code.
Any idea on mutual exclusivity of the timer function?
Thank you.
Thank you for the reply. Seems like they pre compiled those into .a files. Dont know why they do that.
It would be really helpful to debug and learn the device if there are uncompiled source files.
https://github.com/espressif/esp-idf/bl ... sp_timer.c only have three lines which uses the function output. Not its source code.
Any idea on mutual exclusivity of the timer function?
Thank you.
-
- Posts: 9730
- Joined: Thu Nov 26, 2015 4:08 am
Re: Finding source code for esp_timer_get_time()
Where that function is defined depends a bit on the specific hardware timer that it's selected to use... I think by default it's timer group 0, in case the function is aliased to esp_timer_impl_get_time here, with that function defined just above that. (Note that this is for 4.2, other versions may handle this slightly different)
-
- Posts: 13
- Joined: Thu Jul 30, 2020 2:40 pm
Re: Finding source code for esp_timer_get_time()
Hello ESP_Sprite
Thank you for the help. Can you please answer this also.
I think version 4.2 is included in the latest ESP32 arduino core, right?.
Currently arduino millis function use this to get the time.
Millis is used all over the arduino. Is it ok to use millis in multiple tasks without mutual exclusivity?.
I also use a timer interrupt attached to timer 0. Is this somehow affect the millis.?
Thank you
Thank you for the help. Can you please answer this also.
I think version 4.2 is included in the latest ESP32 arduino core, right?.
Currently arduino millis function use this to get the time.
Millis is used all over the arduino. Is it ok to use millis in multiple tasks without mutual exclusivity?.
I also use a timer interrupt attached to timer 0. Is this somehow affect the millis.?
Thank you
-
- Posts: 9730
- Joined: Thu Nov 26, 2015 4:08 am
Re: Finding source code for esp_timer_get_time()
Yes, that code should be re-entrant. You can also use timer0 for other purposes, esp_timer uses a legacy subsystem of the timer groups that is not usually used/usable by other code.
Who is online
Users browsing this forum: bfredo123 and 110 guests