Browse Source

Patch home_all_axes to ignore G28 XYZ parameters

Scott Lahteine 8 years ago
parent
commit
238fb53617
1 changed files with 16 additions and 14 deletions
  1. 16
    14
      Marlin/Marlin_main.cpp

+ 16
- 14
Marlin/Marlin_main.cpp View File

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

Loading…
Cancel
Save