I'm writing code for a battery powered device that measures how long an RTC GPIO is being held high. Because it's battery powered, I want it to be in deep sleep as much as possible. I made a working code using the timer wake up:
Code: Select all
esp_sleep_enable_timer_wakeup(time_in_us)
What I would like to do is use the external wake up:
Code: Select all
esp_sleep_enable_ext0_wakeup(GPIO_NUM_X, level)
Is there a way to read how long it had been in deep sleep? If not, suggestions for workarounds are of course welcome. Thanks!