serial_dump: manipulate WDT just once
This commit is contained in:
parent
928c7211ad
commit
d193d0f7ac
|
|
@ -973,9 +973,12 @@ bool emergency_serial_dump = false;
|
||||||
|
|
||||||
void serial_dump_and_reset(uint16_t sp, dump_crash_reason reason)
|
void serial_dump_and_reset(uint16_t sp, dump_crash_reason reason)
|
||||||
{
|
{
|
||||||
// we're being called from a live state, so shut off interrupts and heaters
|
|
||||||
cli();
|
cli();
|
||||||
wdt_enable(WDTO_15MS);
|
|
||||||
|
// extend WDT long enough to allow writing the entire stream
|
||||||
|
wdt_enable(WDTO_8S);
|
||||||
|
|
||||||
|
// we're being called from a live state, so shut off interrupts and heaters
|
||||||
WRITE(FAN_PIN, HIGH);
|
WRITE(FAN_PIN, HIGH);
|
||||||
disable_heater();
|
disable_heater();
|
||||||
|
|
||||||
|
|
@ -987,8 +990,6 @@ void serial_dump_and_reset(uint16_t sp, dump_crash_reason reason)
|
||||||
SERIAL_ECHO(" ");
|
SERIAL_ECHO(" ");
|
||||||
SERIAL_ECHOLN((unsigned)reason);
|
SERIAL_ECHOLN((unsigned)reason);
|
||||||
|
|
||||||
// set WDT long enough to allow writing the entire stream
|
|
||||||
wdt_enable(WDTO_8S);
|
|
||||||
print_mem(0, RAMEND+1, dcode_mem_t::sram);
|
print_mem(0, RAMEND+1, dcode_mem_t::sram);
|
||||||
SERIAL_ECHOLNRPGM(MSG_OK);
|
SERIAL_ECHOLNRPGM(MSG_OK);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue