Close SD file in print_stop instead of UnconditionalStop()

Change in memory:
Flash: -6 bytes
SRAM: 0 bytes
This commit is contained in:
Guðni Már Gilbert 2023-08-13 17:37:05 +00:00
parent 3ad40f0206
commit 30d0da4698
2 changed files with 5 additions and 7 deletions

View File

@ -9685,12 +9685,6 @@ void UnconditionalStop()
cmdqueue_reset();
cmdqueue_serial_disabled = false;
// Reset the sd status
if (card.sdprinting) {
card.sdprinting = false;
card.closefile();
}
st_reset_timer();
CRITICAL_SECTION_END;
}

View File

@ -5646,7 +5646,11 @@ void print_stop(bool interactive)
// called by the main loop one iteration later.
UnconditionalStop();
if (!card.sdprinting) {
if (card.sdprinting) {
// Reset the sd status
card.sdprinting = false;
card.closefile();
} else {
SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_CANCEL); // for Octoprint
}