Page 1 of 1

Any way to diff power startup with recovering from deep sleep.

Posted: Fri Dec 13, 2019 5:10 am
by charlieyang
Hi all !

I'd like to add some special operations to setup() functions but I don't want to invoke them when the device is recovered from a deep sleep. Since deep sleep turns off all the device except the RTC, the program will be totally restarted after deep sleep. Is there any indicator (variables, system call?) to identify the exact status?

Thanks!

Re: Any way to diff power startup with recovering from deep sleep.

Posted: Fri Dec 13, 2019 3:17 pm
by martinayotte
rtc_get_reset_reason() from "rom/rtc.h"

https://github.com/espressif/arduino-es ... .h#L82-L99