crashdet_cancel doesnt cleanup all variables when using Octoprint
I would think that this should behave similarly as when stopping the print via the LCD. Changed UnconditionalSto()p to not close the SD card file if we're using Octoprint. Then there shouldnt be any file open. Some of the variables which were not reset: isPrintPaused pause_time saved_start_position saved_printing_type Bed heater may be left on? Change in memory: Flash: -28 bytes SRAM: 0 bytes
This commit is contained in:
parent
8615a8dad5
commit
3ad40f0206
|
|
@ -635,16 +635,9 @@ void crashdet_recover()
|
|||
if (lcd_crash_detect_enabled()) tmc2130_sg_stop_on_crash = true;
|
||||
}
|
||||
|
||||
void crashdet_cancel()
|
||||
{
|
||||
saved_printing = false;
|
||||
tmc2130_sg_stop_on_crash = true;
|
||||
if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) {
|
||||
print_stop();
|
||||
}else if(saved_printing_type == PowerPanic::PRINT_TYPE_USB){
|
||||
SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_CANCEL); //for Octoprint: works the same as clicking "Abort" button in Octoprint GUI
|
||||
cmdqueue_reset();
|
||||
}
|
||||
/// Crash detection cancels the print
|
||||
void crashdet_cancel() {
|
||||
print_stop();
|
||||
}
|
||||
|
||||
#endif //TMC2130
|
||||
|
|
@ -9693,8 +9686,10 @@ void UnconditionalStop()
|
|||
cmdqueue_serial_disabled = false;
|
||||
|
||||
// Reset the sd status
|
||||
card.sdprinting = false;
|
||||
card.closefile();
|
||||
if (card.sdprinting) {
|
||||
card.sdprinting = false;
|
||||
card.closefile();
|
||||
}
|
||||
|
||||
st_reset_timer();
|
||||
CRITICAL_SECTION_END;
|
||||
|
|
|
|||
Loading…
Reference in New Issue