xflash_dump.h 628 B

123456789101112131415161718192021222324
  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. bad_pullup_temp_isr,
  11. bad_pullup_step_isr,
  12. };
  13. #ifdef XFLASH_DUMP
  14. void xfdump_reset(); // reset XFLASH dump state
  15. void xfdump_dump(); // create a new SRAM memory dump
  16. // return true if a dump is present, save type in "reason" if provided
  17. bool xfdump_check_state(dump_crash_reason* reason = NULL);
  18. // create a new dump containing registers and SRAM, then reset
  19. void xfdump_full_dump_and_reset(dump_crash_reason crash = dump_crash_reason::manual);
  20. #endif