mirror of
https://github.com/esphome/esphome.git
synced 2026-09-21 20:18:43 +00:00
Merge branch 'fix-rp2040-debug-reset-reason' into integration
This commit is contained in:
@@ -41,15 +41,19 @@ const char *DebugComponent::get_reset_reason_(std::span<char, RESET_REASON_BUFFE
|
||||
#endif
|
||||
|
||||
if (watchdog_caused_reboot()) {
|
||||
bool handled = false;
|
||||
#ifdef USE_RP2040_CRASH_HANDLER
|
||||
if (rp2040::crash_handler_has_data()) {
|
||||
pos = buf_append_str(buf, size, pos, "Crash (HardFault)|");
|
||||
} else
|
||||
handled = true;
|
||||
}
|
||||
#endif
|
||||
if (watchdog_enable_caused_reboot()) {
|
||||
pos = buf_append_str(buf, size, pos, "Watchdog timeout|");
|
||||
} else {
|
||||
pos = buf_append_str(buf, size, pos, "Software reset|");
|
||||
if (!handled) {
|
||||
if (watchdog_enable_caused_reboot()) {
|
||||
pos = buf_append_str(buf, size, pos, "Watchdog timeout|");
|
||||
} else {
|
||||
pos = buf_append_str(buf, size, pos, "Software reset|");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1079,7 +1079,7 @@ __attribute__((format(printf, 4, 5))) inline size_t buf_append_printf(char *buf,
|
||||
/// @param buf Output buffer
|
||||
/// @param size Total buffer size
|
||||
/// @param pos Current position in buffer
|
||||
/// @param str String to append
|
||||
/// @param str String to append (must not be null)
|
||||
/// @return New position after appending (capped at size on overflow)
|
||||
inline size_t buf_append_str(char *buf, size_t size, size_t pos, const char *str) {
|
||||
if (pos >= size) {
|
||||
|
||||
Reference in New Issue
Block a user