From abcb1017f36b39d3d354fe8ca8dd70fabfc17bb8 Mon Sep 17 00:00:00 2001 From: gudnimg Date: Sat, 27 Jan 2024 15:21:08 +0000 Subject: [PATCH] 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. --- Firmware/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index ab01e8e9c..c45c75639 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -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();