Prusa-Firmware/Firmware/xflash_dump.h
Yuri D'Elia 3187b96ca4 xfdump: report to the host that a dump is available
As suggested by @3d-gussner, announce to the host that a dump is
available for retrieval using an action "dump_available".

Any kind of dump is announced (even if manually triggered).

To avoid reading from xflash twice, remove some duplication and return
the crash reason directly in xfdump_check_state().
2021-06-11 19:21:51 +02:00

23 lines
574 B
C

// XFLASH dumper
#pragma once
#include "xflash_layout.h"
#ifdef XFLASH_DUMP
void xfdump_reset(); // reset XFLASH dump state
void xfdump_dump(); // create a new SRAM memory dump
enum class dump_crash_reason : uint8_t
{
manual = 0,
stack_error,
watchdog,
};
// return true if a dump is present, save type in "reason" if provided
bool xfdump_check_state(dump_crash_reason* reason = NULL);
// create a new dump containing registers and SRAM, then reset
void xfdump_full_dump_and_reset(dump_crash_reason crash = dump_crash_reason::manual);
#endif