SOLVED: Differentiate between deep.sleep and power on reset
Posted: Fri Feb 26, 2016 9:44 am
Hello,
is it possible to differentiate in the code between a power on reset and a reset from deep sleep?
always gives
is it possible to differentiate in the code between a power on reset and a reset from deep sleep?
Code: Select all
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
Code: Select all
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