recently somebody asked a question about the rollover of millis() on ESP32-boards.
I tried to find the definition of the function millis() but had no luck so far.
I found something in
...packages\arduino\hardware\mbed\1.1.6\cores\arduino\wiring.cpp
unsigned long millis()
{
return t.read_ms();
}
but I'm still unsure if this is the defintion used if I compile for the platform ESP32
So does somebody know where this definition is or a method to really find it?
Of course, that just begs the question .... why would you ever use millis() on an ESP32? The esp_timer_get_time() function returns a 64-bit integer, has microsecond-resolution, and won't roll over for more than 290,000 years.
yes very good question. hm well one argument is "oldwards" compatibility to Arduino Uno / Mega
Whenever I would like to re-use some code written for ESP on an Arduino this would require re-editing or do you have a clever solution how to make things like
Much of ESP32/ESP8266 Arduino cores are wrapper functions. If can get a bit hairy to go looking under the covers because you just find templates, macros, and raw IDF.
Efficiency and understanding comes from IDF programming the Espressif devices: