Address Copilot review comments

- Fix crash_handler_has_data docstring: returns true for crash reset
  reason (exception/WDT), not dependent on RTC backtrace presence
- Always log numeric exccause in fallback branch for unexpected causes
This commit is contained in:
J. Nick Koston
2026-04-05 16:27:07 -10:00
parent e209fb9ef3
commit efc449ccf8
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -186,7 +186,7 @@ void crash_handler_log() {
ESP_LOGE(TAG, " Reason: %s - %s (exccause=%" PRIu32 ")", LOG_STR_ARG(get_reset_reason(resetInfo.reason)),
LOG_STR_ARG(cause), exccause);
} else {
ESP_LOGE(TAG, " Reason: %s", LOG_STR_ARG(get_reset_reason(resetInfo.reason)));
ESP_LOGE(TAG, " Reason: %s (exccause=%" PRIu32 ")", LOG_STR_ARG(get_reset_reason(resetInfo.reason)), exccause);
}
ESP_LOGE(TAG, " PC: 0x%08" PRIX32, resetInfo.epc1);
if (resetInfo.reason == REASON_EXCEPTION_RST) {
+1 -1
View File
@@ -11,7 +11,7 @@ namespace esphome::esp8266 {
/// Log crash data if a crash was detected on previous boot.
void crash_handler_log();
/// Returns true if crash data was found this boot.
/// Returns true if the previous boot was a crash (exception, WDT, or soft WDT).
bool crash_handler_has_data();
} // namespace esphome::esp8266