Move stack checking to the temperature ISR

Now that the stack_error function is truly minimal,
we can check for stack errors much more frequently.

Also move away stack_error from ultralcd to Marlin_main.
This commit is contained in:
Yuri D'Elia 2021-06-12 15:21:16 +02:00
parent 01934b89e9
commit 050cf72e98
5 changed files with 19 additions and 21 deletions

View file

@ -1727,6 +1727,20 @@ ISR(WDT_vect)
}
#endif
void stack_error() {
WRITE(BEEPER, HIGH);
eeprom_update_byte((uint8_t*)EEPROM_FW_CRASH_FLAG, (uint8_t)dump_crash_reason::stack_error);
#ifdef EMERGENCY_DUMP
xfdump_full_dump_and_reset(dump_crash_reason::stack_error);
#elif defined(EMERGENCY_SERIAL_DUMP)
if (emergency_serial_dump)
serial_dump_and_reset(dump_crash_reason::stack_error);
#endif
softReset();
}
void trace();
#define CHUNK_SIZE 64 // bytes