@@ -333,12 +333,12 @@ void disable_all_steppers() {
333333/* *
334334 * A Print Job exists when the timer is running or SD is printing
335335 */
336- bool printJobOngoing () {
337- return print_job_timer.isRunning () || IS_SD_PRINTING ();
338- }
336+ bool printJobOngoing () { return print_job_timer.isRunning () || IS_SD_PRINTING (); }
339337
340338/* *
339+ * Printing is active when a job is underway but not paused
341340 */
341+ bool printingIsActive () { return !did_pause_print && printJobOngoing (); }
342342
343343/* *
344344 * Printing is paused according to SD or host indicators
@@ -363,7 +363,7 @@ void startOrResumeJob() {
363363
364364 inline void abortSDPrinting () {
365365 IF_DISABLED (NO_SD_AUTOSTART, card.autofile_cancel ());
366- card.endFilePrint (TERN_ (SD_RESORT, true ));
366+ card.abortFilePrint (TERN_ (SD_RESORT, true ));
367367
368368 queue.clear ();
369369 quickstop_stepper ();
@@ -386,8 +386,8 @@ void startOrResumeJob() {
386386 }
387387
388388 inline void finishSDPrinting () {
389- if (queue.enqueue_one_P (PSTR (" M1001" ))) {
390- marlin_state = MF_RUNNING;
389+ if (queue.enqueue_one_P (PSTR (" M1001" ))) { // Keep trying until it gets queued
390+ marlin_state = MF_RUNNING; // Signal to stop trying
391391 TERN_ (PASSWORD_AFTER_SD_PRINT_END, password.lock_machine ());
392392 TERN_ (DGUS_LCD_UI_MKS, ScreenHandler.SDPrintingFinished ());
393393 }
@@ -897,7 +897,7 @@ void stop() {
897897 thermalManager.set_fans_paused (false ); // Un-pause fans for safety
898898 #endif
899899
900- if (IsRunning ()) {
900+ if (! IsStopped ()) {
901901 SERIAL_ERROR_MSG (STR_ERR_STOPPED);
902902 LCD_MESSAGEPGM (MSG_STOPPED);
903903 safe_delay (350 ); // allow enough time for messages to get out before stopping
0 commit comments