bad ISR catch

This commit is contained in:
Voinea Dragos 2021-06-14 11:30:38 +03:00
parent d2041ee2fe
commit 8e667a8acd
2 changed files with 16 additions and 0 deletions

View file

@ -1727,6 +1727,21 @@ ISR(WDT_vect)
}
#endif
#if defined(WATCHDOG) && defined(EMERGENCY_HANDLERS)
ISR(BADISR_vect)
{
WRITE(BEEPER, HIGH);
eeprom_update_byte((uint8_t*)EEPROM_FW_CRASH_FLAG, (uint8_t)dump_crash_reason::bad_isr);
#ifdef EMERGENCY_DUMP
xfdump_full_dump_and_reset(dump_crash_reason::bad_isr);
#elif defined(EMERGENCY_SERIAL_DUMP)
if(emergency_serial_dump)
serial_dump_and_reset(dump_crash_reason::bad_isr);
#endif
softReset();
}
#endif
void stack_error() {
WRITE(BEEPER, HIGH);

View file

@ -7,6 +7,7 @@ enum class dump_crash_reason : uint8_t
manual = 0,
stack_error,
watchdog,
bad_isr,
};
#ifdef XFLASH_DUMP