how to SET esp_timer_get_time() ?
Posted: Thu Dec 10, 2020 2:31 pm
I am using a time critial library (MCCI LMIC), that depends on micros() as monotonic time base. In arduino-esp32 micros() is hardwired to esp_timer_get_time(), which does not persist it's counter value during deep sleep. Thus micros() cannot act as a monotonic counter after waking up from sleep.
https://github.com/espressif/arduino-es ... isc.c#L134
How can i solve this, without hacking the library?
Is there a way to add an offset by app to esp_timer_get_time()?
- Perhaps by using a wake stub, which adds a sleep time offset immediately after wake up?
- Or is there a way to overwite the micros() function of arduino-esp32 with a customized version?
https://github.com/espressif/arduino-es ... isc.c#L134
Code: Select all
unsigned long IRAM_ATTR micros()
{
return (unsigned long) (esp_timer_get_time());
}
Is there a way to add an offset by app to esp_timer_get_time()?
- Perhaps by using a wake stub, which adds a sleep time offset immediately after wake up?
- Or is there a way to overwite the micros() function of arduino-esp32 with a customized version?