Merge branch 'fix-rp2040-debug-reset-reason' into integration

This commit is contained in:
J. Nick Koston
2026-03-12 12:43:46 -10:00
2 changed files with 10 additions and 6 deletions
+9 -5
View File
@@ -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|");
}
}
}
+1 -1
View File
@@ -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) {