xflash_dump.h 578 B

12345678910111213141516171819202122
  1. // XFLASH dumper
  2. #pragma once
  3. #include "xflash_layout.h"
  4. enum class dump_crash_reason : uint8_t
  5. {
  6. manual = 0,
  7. stack_error,
  8. watchdog,
  9. bad_isr,
  10. };
  11. #ifdef XFLASH_DUMP
  12. void xfdump_reset(); // reset XFLASH dump state
  13. void xfdump_dump(); // create a new SRAM memory dump
  14. // return true if a dump is present, save type in "reason" if provided
  15. bool xfdump_check_state(dump_crash_reason* reason = NULL);
  16. // create a new dump containing registers and SRAM, then reset
  17. void xfdump_full_dump_and_reset(dump_crash_reason crash = dump_crash_reason::manual);
  18. #endif