瀏覽代碼

Fix Ender-3 V2 DWIN Stop SD Print (#19642)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
signetica 4 年之前
父節點
當前提交
6fcbf11454
共有 1 個文件被更改,包括 12 次插入29 次删除
  1. 12
    29
      Marlin/src/lcd/dwin/e3v2/dwin.cpp

+ 12
- 29
Marlin/src/lcd/dwin/e3v2/dwin.cpp 查看文件

181
         index_leveling = MROWS,
181
         index_leveling = MROWS,
182
         index_tune     = MROWS;
182
         index_tune     = MROWS;
183
 
183
 
184
-bool dwin_abort_flag = false;
184
+bool dwin_abort_flag = false; // Flag to reset feedrate, return to Home
185
 
185
 
186
 constexpr float default_max_feedrate[]        = DEFAULT_MAX_FEEDRATE;
186
 constexpr float default_max_feedrate[]        = DEFAULT_MAX_FEEDRATE;
187
 constexpr float default_max_acceleration[]    = DEFAULT_MAX_ACCELERATION;
187
 constexpr float default_max_acceleration[]    = DEFAULT_MAX_ACCELERATION;
1801
         // TODO: Move card removed abort handling
1801
         // TODO: Move card removed abort handling
1802
         //       to CardReader::manage_media.
1802
         //       to CardReader::manage_media.
1803
         card.flag.abort_sd_printing = true;
1803
         card.flag.abort_sd_printing = true;
1804
-        wait_for_heatup = false;
1805
-        dwin_abort_flag = true;
1804
+        wait_for_heatup = wait_for_user = false;
1805
+        dwin_abort_flag = true; // Reset feedrate, return to Home
1806
       }
1806
       }
1807
     }
1807
     }
1808
     DWIN_UpdateLCD();
1808
     DWIN_UpdateLCD();
2097
   if (HMI_flag.done_confirm_flag) {
2097
   if (HMI_flag.done_confirm_flag) {
2098
     if (encoder_diffState == ENCODER_DIFF_ENTER) {
2098
     if (encoder_diffState == ENCODER_DIFF_ENTER) {
2099
       HMI_flag.done_confirm_flag = false;
2099
       HMI_flag.done_confirm_flag = false;
2100
-      dwin_abort_flag = true;
2100
+      dwin_abort_flag = true; // Reset feedrate, return to Home
2101
     }
2101
     }
2102
     return;
2102
     return;
2103
   }
2103
   }
2206
     }
2206
     }
2207
     else if (select_print.now == 2) { // stop window
2207
     else if (select_print.now == 2) { // stop window
2208
       if (HMI_flag.select_flag) {
2208
       if (HMI_flag.select_flag) {
2209
-        wait_for_heatup = false; // Stop waiting for heater
2210
-
2211
-        #if 0
2212
-          // TODO: In ExtUI or MarlinUI add a common stop event
2213
-          // card.flag.abort_sd_printing = true;
2214
-        #else
2215
-          checkkey = Back_Main;
2216
-          // Wait for planner moves to finish!
2217
-          if (HMI_flag.home_flag) planner.synchronize();
2218
-          card.endFilePrint();
2219
-          #ifdef ACTION_ON_CANCEL
2220
-            host_action_cancel();
2221
-          #endif
2222
-          #ifdef EVENT_GCODE_SD_ABORT
2223
-            Popup_Window_Home(true);
2224
-            queue.inject_P(PSTR(EVENT_GCODE_SD_ABORT));
2225
-          #endif
2226
-          dwin_abort_flag = true;
2209
+        checkkey = Back_Main;
2210
+        if (HMI_flag.home_flag) planner.synchronize(); // Wait for planner moves to finish!
2211
+        wait_for_heatup = wait_for_user = false;       // Stop waiting for heating/user
2212
+        card.flag.abort_sd_printing = true;            // Let the main loop handle SD abort
2213
+        dwin_abort_flag = true;                        // Reset feedrate, return to Home
2214
+        #ifdef ACTION_ON_CANCEL
2215
+          host_action_cancel();
2227
         #endif
2216
         #endif
2217
+        Popup_Window_Home(true);
2228
       }
2218
       }
2229
       else
2219
       else
2230
         Goto_PrintProcess(); // cancel stop
2220
         Goto_PrintProcess(); // cancel stop
3584
     dwin_abort_flag = false;
3574
     dwin_abort_flag = false;
3585
     HMI_ValueStruct.print_speed = feedrate_percentage = 100;
3575
     HMI_ValueStruct.print_speed = feedrate_percentage = 100;
3586
     dwin_zoffset = TERN0(HAS_BED_PROBE, probe.offset.z);
3576
     dwin_zoffset = TERN0(HAS_BED_PROBE, probe.offset.z);
3587
-
3588
-    planner.finish_and_disable();
3589
-
3590
-    #if DISABLED(SD_ABORT_NO_COOLDOWN)
3591
-      thermalManager.disable_all_heaters();
3592
-    #endif
3593
-
3594
     select_page.set(0);
3577
     select_page.set(0);
3595
     Goto_MainMenu();
3578
     Goto_MainMenu();
3596
   }
3579
   }

Loading…
取消
儲存