Merge pull request #7 from leptun/improve_d2

bad ISR catch
This commit is contained in:
Yuri D'Elia 2021-06-14 12:27:31 +02:00 committed by GitHub
commit e90f5d81ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -1727,6 +1727,21 @@ ISR(WDT_vect)
} }
#endif #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() { void stack_error() {
WRITE(BEEPER, HIGH); WRITE(BEEPER, HIGH);

View File

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