small update of ChipInfo tool

This commit is contained in:
Frank
2022-10-13 19:32:07 +02:00
parent 742f752af7
commit b64981692c

View File

@@ -11,6 +11,9 @@
* detailed license conditions: https://github.com/Jason2866/ESP32_Show_Info/blob/main/LICENSE
*/
#include <Arduino.h>
#ifdef ARDUINO_ARCH_ESP32
#include "soc/spi_reg.h"
#include <soc/efuse_reg.h>
@@ -370,16 +373,38 @@ static void my_show_chip_info(void) {
#include <rom/rtc.h>
#endif
#if 0
// ESP8266 does this a bit differently
//
// include <user_interface.h>
//
// struct rst_info * rst_info;
// system_rtc_mem_read(0, &rst_info, sizeof(rst_info));
// reason = rst_info->reason;
// or
// reason = ESP.getResetInfoPtr()->reason;
//
// REASON_DEFAULT_RST = 0, /* normal startup by power on */
// REASON_WDT_RST = 1, /* hardware watch dog reset */
// REASON_EXCEPTION_RST = 2, /* exception reset, GPIO status wont change */
// REASON_SOFT_WDT_RST = 3, /* software watch dog reset, GPIO status wont change */
// REASON_SOFT_RESTART = 4, /* software restart ,system_restart , GPIO status wont change */
// REASON_DEEP_SLEEP_AWAKE = 5, /* wake up from deep-sleep */
// REASON_EXT_SYS_RST = 6 /* external system reset */
// reason > 6 = user-defined reason codes
#endif
void my_print_reset_reason(int reason)
{
Serial.print(reason);
switch (reason)
{
case 0 : Serial.print (" NA"); break;
case 0 : Serial.print (" NO_MEAN"); break;
case 1 : Serial.print (" POWERON_RESET");break; /**<1, Vbat power on reset*/
case 2 : Serial.print (" unknown exception"); break; /**<2, this code is not defined on ESP32 */
case 3 : Serial.print (" SW_RESET");break; /**<3, Software reset digital core*/
case 4 : Serial.print (" OWDT_RESET");break; /**<4, Legacy watch dog reset digital core*/
case 5 : Serial.print (" DEEPSLEEP_RESET");break; /**<5, Deep Sleep reset digital core*/
case 5 : Serial.print (" DEEPSLEEP_RESET");break; /**<5, Deep Sleep wakeup reset digital core*/
case 6 : Serial.print (" SDIO_RESET");break; /**<6, Reset by SLC module, reset digital core*/
case 7 : Serial.print (" TG0WDT_SYS_RESET");break; /**<7, Timer Group0 Watch dog reset digital core*/
case 8 : Serial.print (" TG1WDT_SYS_RESET");break; /**<8, Timer Group1 Watch dog reset digital core*/
@@ -556,3 +581,8 @@ void showRealSpeed() {
Serial.println(F("====================================\n"));
Serial.flush();
}
#else
#error this tool only supports ESP32 chips
#endif