Fix an issue where print can't be stopped under specific circumstances

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
This commit is contained in:
gudnimg 2023-09-23 14:18:52 +00:00
parent 024178b0fd
commit 3e7dd84102
1 changed files with 1 additions and 1 deletions

View File

@ -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