Browse Source

G28 tweaks

Scott Lahteine 4 years ago
parent
commit
139a33c9fc
2 changed files with 8 additions and 11 deletions
  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 View File

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

+ 2
- 0
Marlin/src/lcd/dwin/e3v2/dwin.h View File

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

Loading…
Cancel
Save