Преглед на файлове

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,7 +181,7 @@ uint8_t index_file     = MROWS,
181 181
         index_leveling = MROWS,
182 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 186
 constexpr float default_max_feedrate[]        = DEFAULT_MAX_FEEDRATE;
187 187
 constexpr float default_max_acceleration[]    = DEFAULT_MAX_ACCELERATION;
@@ -1801,8 +1801,8 @@ void HMI_SDCardUpdate() {
1801 1801
         // TODO: Move card removed abort handling
1802 1802
         //       to CardReader::manage_media.
1803 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 1808
     DWIN_UpdateLCD();
@@ -2097,7 +2097,7 @@ void HMI_Printing() {
2097 2097
   if (HMI_flag.done_confirm_flag) {
2098 2098
     if (encoder_diffState == ENCODER_DIFF_ENTER) {
2099 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 2102
     return;
2103 2103
   }
@@ -2206,25 +2206,15 @@ void HMI_PauseOrStop() {
2206 2206
     }
2207 2207
     else if (select_print.now == 2) { // stop window
2208 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 2216
         #endif
2217
+        Popup_Window_Home(true);
2228 2218
       }
2229 2219
       else
2230 2220
         Goto_PrintProcess(); // cancel stop
@@ -3584,13 +3574,6 @@ void EachMomentUpdate() {
3584 3574
     dwin_abort_flag = false;
3585 3575
     HMI_ValueStruct.print_speed = feedrate_percentage = 100;
3586 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 3577
     select_page.set(0);
3595 3578
     Goto_MainMenu();
3596 3579
   }

Loading…
Отказ
Запис