esp_system: Add reset reasons for USB_UART and USB_JTAG

Merges https://github.com/espressif/esp-idf/pull/10950
This commit is contained in:
Nebojsa Cvetkovic 2023-03-09 01:23:22 +00:00 committed by morris
parent 690aa433a2
commit 67e9db7cf5
6 changed files with 21 additions and 0 deletions

View File

@ -33,6 +33,7 @@ typedef enum {
ESP_RST_DEEPSLEEP, //!< Reset after exiting deep sleep mode
ESP_RST_BROWNOUT, //!< Brownout reset (software or hardware)
ESP_RST_SDIO, //!< Reset over SDIO
ESP_RST_USB, //!< Reset by USB peripheral
} esp_reset_reason_t;
/**

View File

@ -53,6 +53,10 @@ static esp_reset_reason_t get_reset_reason(soc_reset_reason_t rtc_reset_reason,
case RESET_REASON_SYS_BROWN_OUT:
return ESP_RST_BROWNOUT;
case RESET_REASON_CORE_USB_UART:
case RESET_REASON_CORE_USB_JTAG:
return ESP_RST_USB;
default:
return ESP_RST_UNKNOWN;
}

View File

@ -50,6 +50,10 @@ static esp_reset_reason_t get_reset_reason(soc_reset_reason_t rtc_reset_reason,
case RESET_REASON_SYS_BROWN_OUT:
return ESP_RST_BROWNOUT;
case RESET_REASON_CORE_USB_UART:
case RESET_REASON_CORE_USB_JTAG:
return ESP_RST_USB;
default:
return ESP_RST_UNKNOWN;
}

View File

@ -50,6 +50,10 @@ static esp_reset_reason_t get_reset_reason(soc_reset_reason_t rtc_reset_reason,
case RESET_REASON_SYS_BROWN_OUT:
return ESP_RST_BROWNOUT;
case RESET_REASON_CORE_USB_UART:
case RESET_REASON_CORE_USB_JTAG:
return ESP_RST_USB;
default:
return ESP_RST_UNKNOWN;
}

View File

@ -50,6 +50,10 @@ static esp_reset_reason_t get_reset_reason(soc_reset_reason_t rtc_reset_reason,
case RESET_REASON_SYS_BROWN_OUT:
return ESP_RST_BROWNOUT;
case RESET_REASON_CORE_USB_UART:
case RESET_REASON_CORE_USB_JTAG:
return ESP_RST_USB;
default:
return ESP_RST_UNKNOWN;
}

View File

@ -50,6 +50,10 @@ static esp_reset_reason_t get_reset_reason(soc_reset_reason_t rtc_reset_reason,
case RESET_REASON_SYS_BROWN_OUT:
return ESP_RST_BROWNOUT;
case RESET_REASON_CORE_USB_UART:
case RESET_REASON_CORE_USB_JTAG:
return ESP_RST_USB;
default:
return ESP_RST_UNKNOWN;
}