brownout detector: enable by default

Because of errata related to BOD reset function, brownout is handled as follows:

- attach an ISR to brownout interrupt
- when ISR happens, print a message and do a software restart
- esp_restart_nonos enables RTC watchdog, so if restart fails,
  there will be  one more attempt to restart (using the RTC
  watchdog)
This commit is contained in:
Ivan Grokhotkov
2017-06-02 17:50:19 +08:00
parent 780569c04a
commit 01b185977c
6 changed files with 73 additions and 52 deletions

View File

@@ -39,6 +39,7 @@
#include "esp_spi_flash.h"
#include "esp_cache_err_int.h"
#include "esp_app_trace.h"
#include "esp_system.h"
#if CONFIG_SYSVIEW_ENABLE
#include "SEGGER_RTT.h"
#endif
@@ -409,8 +410,6 @@ static void doBacktrace(XtExcFrame *frame)
panicPutStr("\r\n\r\n");
}
void esp_restart_noos() __attribute__ ((noreturn));
/*
We arrive here after a panic or unhandled exception, when no OCD is detected. Dump the registers to the
serial port and either jump to the gdb stub, halt the CPU or reboot.