G28 tweaks

This commit is contained in:
Scott Lahteine 2020-12-05 19:14:15 -06:00
parent a3f6e48eb6
commit 139a33c9fc
2 changed files with 8 additions and 11 deletions

View File

@ -211,10 +211,6 @@ void GcodeSuite::G28() {
TERN_(LASER_MOVE_G28_OFF, cutter.set_inline_enabled(false)); // turn off laser TERN_(LASER_MOVE_G28_OFF, cutter.set_inline_enabled(false)); // turn off laser
TERN_(DWIN_CREALITY_LCD, HMI_flag.home_flag = true);
TERN_(EXTENSIBLE_UI, ExtUI::onHomingStart());
#if ENABLED(DUAL_X_CARRIAGE) #if ENABLED(DUAL_X_CARRIAGE)
bool IDEX_saved_duplication_state = extruder_duplication_enabled; bool IDEX_saved_duplication_state = extruder_duplication_enabled;
DualXMode IDEX_saved_mode = dual_x_carriage_mode; DualXMode IDEX_saved_mode = dual_x_carriage_mode;
@ -236,17 +232,17 @@ void GcodeSuite::G28() {
return; return;
} }
TERN_(DWIN_CREALITY_LCD, DWIN_StartHoming());
TERN_(EXTENSIBLE_UI, ExtUI::onHomingStart());
planner.synchronize(); // Wait for planner moves to finish! planner.synchronize(); // Wait for planner moves to finish!
SET_SOFT_ENDSTOP_LOOSE(false); // Reset a leftover 'loose' motion state SET_SOFT_ENDSTOP_LOOSE(false); // Reset a leftover 'loose' motion state
// Disable the leveling matrix before homing // Disable the leveling matrix before homing
#if HAS_LEVELING #if HAS_LEVELING
// Cancel the active G29 session
TERN_(PROBE_MANUALLY, g29_in_progress = false);
TERN_(RESTORE_LEVELING_AFTER_G28, const bool leveling_was_active = planner.leveling_active); TERN_(RESTORE_LEVELING_AFTER_G28, const bool leveling_was_active = planner.leveling_active);
TERN_(PROBE_MANUALLY, g29_in_progress = false); // Cancel the active G29 session
set_bed_leveling_enabled(false); set_bed_leveling_enabled(false);
#endif #endif
@ -439,8 +435,6 @@ void GcodeSuite::G28() {
do_blocking_move_to_z(delta_clip_start_height); do_blocking_move_to_z(delta_clip_start_height);
#endif #endif
TERN_(RESTORE_LEVELING_AFTER_G28, set_bed_leveling_enabled(leveling_was_active));
restore_feedrate_and_scaling(); restore_feedrate_and_scaling();
// Restore the active tool after homing // Restore the active tool after homing
@ -464,10 +458,11 @@ void GcodeSuite::G28() {
#endif #endif
#endif #endif
TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_restore_state));
ui.refresh(); ui.refresh();
TERN_(DWIN_CREALITY_LCD, DWIN_CompletedHoming()); TERN_(DWIN_CREALITY_LCD, DWIN_CompletedHoming());
TERN_(EXTENSIBLE_UI, ExtUI::onHomingComplete()); TERN_(EXTENSIBLE_UI, ExtUI::onHomingComplete());
report_current_position(); report_current_position();

View File

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