Scott Lahteine 4 år sedan
förälder
incheckning
139a33c9fc
2 ändrade filer med 8 tillägg och 11 borttagningar
  1. 6
    11
      Marlin/src/gcode/calibrate/G28.cpp
  2. 2
    0
      Marlin/src/lcd/dwin/e3v2/dwin.h

+ 6
- 11
Marlin/src/gcode/calibrate/G28.cpp Visa fil

@@ -211,10 +211,6 @@ void GcodeSuite::G28() {
211 211
 
212 212
   TERN_(LASER_MOVE_G28_OFF, cutter.set_inline_enabled(false));  // turn off laser
213 213
 
214
-  TERN_(DWIN_CREALITY_LCD, HMI_flag.home_flag = true);
215
-
216
-  TERN_(EXTENSIBLE_UI, ExtUI::onHomingStart());
217
-
218 214
   #if ENABLED(DUAL_X_CARRIAGE)
219 215
     bool IDEX_saved_duplication_state = extruder_duplication_enabled;
220 216
     DualXMode IDEX_saved_mode = dual_x_carriage_mode;
@@ -236,17 +232,17 @@ void GcodeSuite::G28() {
236 232
     return;
237 233
   }
238 234
 
235
+  TERN_(DWIN_CREALITY_LCD, DWIN_StartHoming());
236
+  TERN_(EXTENSIBLE_UI, ExtUI::onHomingStart());
237
+
239 238
   planner.synchronize();          // Wait for planner moves to finish!
240 239
 
241 240
   SET_SOFT_ENDSTOP_LOOSE(false);  // Reset a leftover 'loose' motion state
242 241
 
243 242
   // Disable the leveling matrix before homing
244 243
   #if HAS_LEVELING
245
-
246
-    // Cancel the active G29 session
247
-    TERN_(PROBE_MANUALLY, g29_in_progress = false);
248
-
249 244
     TERN_(RESTORE_LEVELING_AFTER_G28, const bool leveling_was_active = planner.leveling_active);
245
+    TERN_(PROBE_MANUALLY, g29_in_progress = false);  // Cancel the active G29 session
250 246
     set_bed_leveling_enabled(false);
251 247
   #endif
252 248
 
@@ -439,8 +435,6 @@ void GcodeSuite::G28() {
439 435
     do_blocking_move_to_z(delta_clip_start_height);
440 436
   #endif
441 437
 
442
-  TERN_(RESTORE_LEVELING_AFTER_G28, set_bed_leveling_enabled(leveling_was_active));
443
-
444 438
   restore_feedrate_and_scaling();
445 439
 
446 440
   // Restore the active tool after homing
@@ -464,10 +458,11 @@ void GcodeSuite::G28() {
464 458
     #endif
465 459
   #endif
466 460
 
461
+  TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_restore_state));
462
+
467 463
   ui.refresh();
468 464
 
469 465
   TERN_(DWIN_CREALITY_LCD, DWIN_CompletedHoming());
470
-
471 466
   TERN_(EXTENSIBLE_UI, ExtUI::onHomingComplete());
472 467
 
473 468
   report_current_position();

+ 2
- 0
Marlin/src/lcd/dwin/e3v2/dwin.h Visa fil

@@ -369,5 +369,7 @@ void DWIN_Update();
369 369
 void EachMomentUpdate();
370 370
 void DWIN_HandleScreen();
371 371
 
372
+inline void DWIN_StartHoming() { HMI_flag.home_flag = true; }
373
+
372 374
 void DWIN_CompletedHoming();
373 375
 void DWIN_CompletedLeveling();

Laddar…
Avbryt
Spara