From 3e7dd84102f408ab6e1908d5a03dbd0f7e24b738 Mon Sep 17 00:00:00 2001 From: gudnimg Date: Sat, 23 Sep 2023 14:18:52 +0000 Subject: [PATCH] Fix an issue where print can't be stopped under specific circumstances MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is a bug where if the printer is recovering a print, it run a blocking loop to restore the extruder and bed temperatures. But if a Fan error is triggered in this loop, then the user can't abort the print via LCD. If the fan error resolves on its own the 'Resume print' menu will appear in a few seconds. But if not, then the user can't resume the print (which is normal). But with the bug above the user can't abort the print either! The problem is essentially isPrintPaused variable is cleared too early. We should wait until the print is completely restored first. Steps to reproduce: 1. Start a print 2. Pause the print 3. Wait for extruder temperature to fall at lest 180°C 4. Click 'Resume' print 5. While heating, stop the hotend fan and wait for a few seconds until an error is raised 6. Observe issue => 'Stop print' menu item is gone! PFW-1542 --- Firmware/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index b4ea94be4..c6c3e155a 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5017,7 +5017,6 @@ void lcd_resume_print() lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); st_synchronize(); custom_message_type = CustomMsg::Resuming; - isPrintPaused = false; // resume processing USB commands again and restore hotend fan state (in case the print was // stopped due to a thermal error) @@ -5025,6 +5024,7 @@ void lcd_resume_print() Stopped = false; restore_print_from_ram_and_continue(default_retraction); + isPrintPaused = false; pause_time += (_millis() - start_pause_print); //accumulate time when print is paused for correct statistics calculation refresh_cmd_timeout(); SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_RESUMED); //resume octoprint