is it possible to differentiate in the code between a power on reset and a reset from deep sleep?
extern "C" {
#include "user_interface.h"
uint16 readvdd33(void);
extern struct rst_info resetInfo;
}
void setup() {
Serial.begin(115200);
Serial.println();
Serial.println("Start...");
Serial.print("Reset reason ");
Serial.println(ESP.getResetInfo());
}
void loop() {
Serial.println("going to sleep now...");
Serial.println(readvdd33());
system_deep_sleep_set_option(0);
system_deep_sleep(15000000); // deep sleep for 15 seconds
delay(1000);
}
always gives
Start...
Reset reason Fatal exception:0 flag:6 (EXT_SYS_RST) epc1:0x00000000 epc2:0x00000000 epc3:0x00000000 excvaddr:0x00000000 depc:0x00000000
going to sleep now...
3365