Rename dump_crash_source to dump_crash_reason

This commit is contained in:
Yuri D'Elia 2021-06-10 17:35:49 +02:00
parent c375610668
commit 31f416fd5e
5 changed files with 12 additions and 12 deletions

View File

@ -1678,7 +1678,7 @@ ISR(WDT_vect)
{
WRITE(BEEPER, 1);
eeprom_update_byte((uint8_t*)EEPROM_CRASH_ACKNOWLEDGED, 0);
xfdump_full_dump_and_reset(dump_crash_source::watchdog);
xfdump_full_dump_and_reset(dump_crash_reason::watchdog);
}
#endif

View File

@ -6714,7 +6714,7 @@ static void lcd_main_menu()
void stack_error() {
WRITE(BEEPER, HIGH);
eeprom_update_byte((uint8_t*)EEPROM_CRASH_ACKNOWLEDGED, 0);
xfdump_full_dump_and_reset(dump_crash_source::stack_error);
xfdump_full_dump_and_reset(dump_crash_reason::stack_error);
}
#else
void stack_error() {

View File

@ -26,10 +26,10 @@ bool xfdump_check_crash()
if(!xfdump_check_state())
return false;
dump_crash_source crash;
xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.crash_type),
(uint8_t*)&crash, sizeof(crash));
return (crash != dump_crash_source::manual);
dump_crash_reason reason;
xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.crash_reason),
(uint8_t*)&reason, sizeof(reason));
return (reason != dump_crash_reason::manual);
}
@ -80,7 +80,7 @@ void xfdump_dump()
dump_header_t buf;
buf.magic = DUMP_MAGIC;
buf.regs_present = false;
buf.crash_type = (uint8_t)dump_crash_source::manual;
buf.crash_reason = (uint8_t)dump_crash_reason::manual;
// write sram only
xfdump_dump_core(buf, DUMP_OFFSET + offsetof(dump_t, data.sram),
@ -88,12 +88,12 @@ void xfdump_dump()
}
void xfdump_full_dump_and_reset(dump_crash_source crash)
void xfdump_full_dump_and_reset(dump_crash_reason reason)
{
dump_header_t buf;
buf.magic = DUMP_MAGIC;
buf.regs_present = true;
buf.crash_type = (uint8_t)crash;
buf.crash_reason = (uint8_t)reason;
// disable interrupts for a cleaner register dump
cli();

View File

@ -8,7 +8,7 @@ bool xfdump_check_state(); // return true if a dump is present
bool xfdump_check_crash(); // return true if a dump is present and is a crash dump
void xfdump_dump(); // create a new SRAM memory dump
enum class dump_crash_source : uint8_t
enum class dump_crash_reason : uint8_t
{
manual = 0,
stack_error,
@ -16,6 +16,6 @@ enum class dump_crash_source : uint8_t
};
// create a new dump containing registers and SRAM, then reset
void xfdump_full_dump_and_reset(dump_crash_source crash = dump_crash_source::manual);
void xfdump_full_dump_and_reset(dump_crash_reason crash = dump_crash_reason::manual);
#endif

View File

@ -20,7 +20,7 @@ struct dump_header_t
uint32_t magic;
uint8_t regs_present; // true when the lower segment containing registers is present
uint8_t crash_type; // uses values from dump_crash_source
uint8_t crash_reason; // uses values from dump_crash_source
};
struct dump_data_t