Bläddra i källkod

Patch home_all_axes to ignore G28 XYZ parameters

Scott Lahteine 7 år sedan
förälder
incheckning
238fb53617
1 ändrade filer med 16 tillägg och 14 borttagningar
  1. 16
    14
      Marlin/Marlin_main.cpp

+ 16
- 14
Marlin/Marlin_main.cpp Visa fil

@@ -3713,7 +3713,7 @@ inline void gcode_G4() {
3713 3713
  *  Z   Home to the Z endstop
3714 3714
  *
3715 3715
  */
3716
-inline void gcode_G28() {
3716
+inline void gcode_G28(const bool always_home_all) {
3717 3717
 
3718 3718
   #if ENABLED(DEBUG_LEVELING_FEATURE)
3719 3719
     if (DEBUGGING(LEVELING)) {
@@ -3760,14 +3760,16 @@ inline void gcode_G28() {
3760 3760
 
3761 3761
   #else // NOT DELTA
3762 3762
 
3763
-    const bool homeX = code_seen('X'), homeY = code_seen('Y'), homeZ = code_seen('Z'),
3764
-               home_all_axis = (!homeX && !homeY && !homeZ) || (homeX && homeY && homeZ);
3763
+    const bool homeX = always_home_all || code_seen('X'),
3764
+               homeY = always_home_all || code_seen('Y'),
3765
+               homeZ = always_home_all || code_seen('Z'),
3766
+               home_all = (!homeX && !homeY && !homeZ) || (homeX && homeY && homeZ);
3765 3767
 
3766 3768
     set_destination_to_current();
3767 3769
 
3768 3770
     #if Z_HOME_DIR > 0  // If homing away from BED do Z first
3769 3771
 
3770
-      if (home_all_axis || homeZ) {
3772
+      if (home_all || homeZ) {
3771 3773
         HOMEAXIS(Z);
3772 3774
         #if ENABLED(DEBUG_LEVELING_FEATURE)
3773 3775
           if (DEBUGGING(LEVELING)) DEBUG_POS("> HOMEAXIS(Z)", current_position);
@@ -3776,7 +3778,7 @@ inline void gcode_G28() {
3776 3778
 
3777 3779
     #else
3778 3780
 
3779
-      if (home_all_axis || homeX || homeY) {
3781
+      if (home_all || homeX || homeY) {
3780 3782
         // Raise Z before homing any other axes and z is not already high enough (never lower z)
3781 3783
         destination[Z_AXIS] = LOGICAL_Z_POSITION(Z_HOMING_HEIGHT);
3782 3784
         if (destination[Z_AXIS] > current_position[Z_AXIS]) {
@@ -3794,14 +3796,14 @@ inline void gcode_G28() {
3794 3796
 
3795 3797
     #if ENABLED(QUICK_HOME)
3796 3798
 
3797
-      if (home_all_axis || (homeX && homeY)) quick_home_xy();
3799
+      if (home_all || (homeX && homeY)) quick_home_xy();
3798 3800
 
3799 3801
     #endif
3800 3802
 
3801 3803
     #if ENABLED(HOME_Y_BEFORE_X)
3802 3804
 
3803 3805
       // Home Y
3804
-      if (home_all_axis || homeY) {
3806
+      if (home_all || homeY) {
3805 3807
         HOMEAXIS(Y);
3806 3808
         #if ENABLED(DEBUG_LEVELING_FEATURE)
3807 3809
           if (DEBUGGING(LEVELING)) DEBUG_POS("> homeY", current_position);
@@ -3811,7 +3813,7 @@ inline void gcode_G28() {
3811 3813
     #endif
3812 3814
 
3813 3815
     // Home X
3814
-    if (home_all_axis || homeX) {
3816
+    if (home_all || homeX) {
3815 3817
 
3816 3818
       #if ENABLED(DUAL_X_CARRIAGE)
3817 3819
 
@@ -3844,7 +3846,7 @@ inline void gcode_G28() {
3844 3846
 
3845 3847
     #if DISABLED(HOME_Y_BEFORE_X)
3846 3848
       // Home Y
3847
-      if (home_all_axis || homeY) {
3849
+      if (home_all || homeY) {
3848 3850
         HOMEAXIS(Y);
3849 3851
         #if ENABLED(DEBUG_LEVELING_FEATURE)
3850 3852
           if (DEBUGGING(LEVELING)) DEBUG_POS("> homeY", current_position);
@@ -3854,16 +3856,16 @@ inline void gcode_G28() {
3854 3856
 
3855 3857
     // Home Z last if homing towards the bed
3856 3858
     #if Z_HOME_DIR < 0
3857
-      if (home_all_axis || homeZ) {
3859
+      if (home_all || homeZ) {
3858 3860
         #if ENABLED(Z_SAFE_HOMING)
3859 3861
           home_z_safely();
3860 3862
         #else
3861 3863
           HOMEAXIS(Z);
3862 3864
         #endif
3863 3865
         #if ENABLED(DEBUG_LEVELING_FEATURE)
3864
-          if (DEBUGGING(LEVELING)) DEBUG_POS("> (home_all_axis || homeZ) > final", current_position);
3866
+          if (DEBUGGING(LEVELING)) DEBUG_POS("> (home_all || homeZ) > final", current_position);
3865 3867
         #endif
3866
-      } // home_all_axis || homeZ
3868
+      } // home_all || homeZ
3867 3869
     #endif // Z_HOME_DIR < 0
3868 3870
 
3869 3871
     SYNC_PLAN_POSITION_KINEMATIC();
@@ -3895,7 +3897,7 @@ inline void gcode_G28() {
3895 3897
   #endif
3896 3898
 } // G28
3897 3899
 
3898
-void home_all_axes() { gcode_G28(); }
3900
+void home_all_axes() { gcode_G28(true); }
3899 3901
 
3900 3902
 #if HAS_PROBING_PROCEDURE
3901 3903
 
@@ -9858,7 +9860,7 @@ void process_next_command() {
9858 9860
       #endif // NOZZLE_PARK_FEATURE
9859 9861
 
9860 9862
       case 28: // G28: Home all axes, one at a time
9861
-        gcode_G28();
9863
+        gcode_G28(false);
9862 9864
         break;
9863 9865
 
9864 9866
       #if HAS_LEVELING

Laddar…
Avbryt
Spara