PFW-1553 fix regression where SD card file is not closed when stopping paused print

When a print is paused, card.sdprinting is set to false. Instead we can check
if the SD card has been mounted and try to close the file.

The closefile() method will check internally whether or not the file is open.
This commit is contained in:
gudnimg 2024-01-27 15:21:08 +00:00
parent 8fa97cffda
commit abcb1017f3
1 changed files with 1 additions and 1 deletions

View File

@ -5709,7 +5709,7 @@ void print_stop(bool interactive)
// called by the main loop one iteration later.
UnconditionalStop();
if (card.sdprinting) {
if (card.mounted) {
// Reset the sd status
card.sdprinting = false;
card.closefile();