Browse Source

🎨 Flags for homing directions

Scott Lahteine 3 years ago
parent
commit
49771c4a9e

+ 1
- 1
Marlin/src/HAL/LPC1768/inc/SanityCheck.h View File

@@ -144,7 +144,7 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o
144 144
     #error "Serial port pins (2) conflict with Z4 pins!"
145 145
   #elif ANY_RX(2, X_DIR_PIN, Y_DIR_PIN)
146 146
     #error "Serial port pins (2) conflict with other pins!"
147
-  #elif Y_HOME_DIR < 0 && IS_TX2(Y_STOP_PIN)
147
+  #elif Y_HOME_TO_MIN && IS_TX2(Y_STOP_PIN)
148 148
     #error "Serial port pins (2) conflict with Y endstop pin!"
149 149
   #elif HAS_CUSTOM_PROBE_PIN && IS_TX2(Z_MIN_PROBE_PIN)
150 150
     #error "Serial port pins (2) conflict with probe pin!"

+ 1
- 1
Marlin/src/feature/powerloss.cpp View File

@@ -375,7 +375,7 @@ void PrintJobRecovery::resume() {
375 375
 
376 376
   gcode.process_subcommands_now_P(PSTR("G92.9E0")); // Reset E to 0
377 377
 
378
-  #if Z_HOME_DIR > 0
378
+  #if Z_HOME_TO_MAX
379 379
 
380 380
     float z_now = z_raised;
381 381
 

+ 1
- 1
Marlin/src/gcode/calibrate/G28.cpp View File

@@ -73,7 +73,7 @@
73 73
     current_position.set(0.0, 0.0);
74 74
     sync_plan_position();
75 75
 
76
-    const int x_axis_home_dir = x_home_dir(active_extruder);
76
+    const int x_axis_home_dir = TOOL_X_HOME_DIR(active_extruder);
77 77
 
78 78
     const float mlx = max_length(X_AXIS),
79 79
                 mly = max_length(Y_AXIS),

+ 19
- 2
Marlin/src/inc/Conditionals_LCD.h View File

@@ -814,6 +814,23 @@
814 814
   #endif
815 815
 #endif // FILAMENT_RUNOUT_SENSOR
816 816
 
817
+// Homing to Min or Max
818
+#if X_HOME_DIR > 0
819
+  #define X_HOME_TO_MAX 1
820
+#elif X_HOME_DIR < 0
821
+  #define X_HOME_TO_MIN 1
822
+#endif
823
+#if Y_HOME_DIR > 0
824
+  #define Y_HOME_TO_MAX 1
825
+#elif Y_HOME_DIR < 0
826
+  #define Y_HOME_TO_MIN 1
827
+#endif
828
+#if Z_HOME_DIR > 0
829
+  #define Z_HOME_TO_MAX 1
830
+#elif Z_HOME_DIR < 0
831
+  #define Z_HOME_TO_MIN 1
832
+#endif
833
+
817 834
 #if HAS_BED_PROBE
818 835
   #if DISABLED(NOZZLE_AS_PROBE)
819 836
     #define HAS_PROBE_XY_OFFSET 1
@@ -821,7 +838,7 @@
821 838
   #if DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && !BOTH(DELTA, SENSORLESS_PROBING)
822 839
     #define HAS_CUSTOM_PROBE_PIN 1
823 840
   #endif
824
-  #if Z_HOME_DIR < 0 && (!HAS_CUSTOM_PROBE_PIN || ENABLED(USE_PROBE_FOR_Z_HOMING))
841
+  #if Z_HOME_TO_MIN && (!HAS_CUSTOM_PROBE_PIN || ENABLED(USE_PROBE_FOR_Z_HOMING))
825 842
     #define HOMING_Z_WITH_PROBE 1
826 843
   #endif
827 844
   #ifndef Z_PROBE_LOW_POINT
@@ -843,7 +860,7 @@
843 860
   #undef USE_PROBE_FOR_Z_HOMING
844 861
 #endif
845 862
 
846
-#if Z_HOME_DIR > 0
863
+#if Z_HOME_TO_MAX
847 864
   #define HOME_Z_FIRST // If homing away from BED do Z first
848 865
 #endif
849 866
 

+ 6
- 0
Marlin/src/inc/Conditionals_adv.h View File

@@ -391,6 +391,12 @@
391 391
   #define POLL_JOG
392 392
 #endif
393 393
 
394
+#if X2_HOME_DIR > 0
395
+  #define X2_HOME_TO_MAX 1
396
+#elif X2_HOME_DIR < 0
397
+  #define X2_HOME_TO_MIN 1
398
+#endif
399
+
394 400
 #ifndef HOMING_BUMP_MM
395 401
   #define HOMING_BUMP_MM { 0, 0, 0 }
396 402
 #endif

+ 8
- 8
Marlin/src/inc/Conditionals_post.h View File

@@ -155,7 +155,7 @@
155 155
 #ifdef MANUAL_X_HOME_POS
156 156
   #define X_HOME_POS MANUAL_X_HOME_POS
157 157
 #else
158
-  #define X_END_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS)
158
+  #define X_END_POS TERN(X_HOME_TO_MIN, X_MIN_POS, X_MAX_POS)
159 159
   #if ENABLED(BED_CENTER_AT_0_0)
160 160
     #define X_HOME_POS TERN(DELTA, 0, X_END_POS)
161 161
   #else
@@ -166,7 +166,7 @@
166 166
 #ifdef MANUAL_Y_HOME_POS
167 167
   #define Y_HOME_POS MANUAL_Y_HOME_POS
168 168
 #else
169
-  #define Y_END_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS)
169
+  #define Y_END_POS TERN(Y_HOME_TO_MIN, Y_MIN_POS, Y_MAX_POS)
170 170
   #if ENABLED(BED_CENTER_AT_0_0)
171 171
     #define Y_HOME_POS TERN(DELTA, 0, Y_END_POS)
172 172
   #else
@@ -177,7 +177,7 @@
177 177
 #ifdef MANUAL_Z_HOME_POS
178 178
   #define Z_HOME_POS MANUAL_Z_HOME_POS
179 179
 #else
180
-  #define Z_HOME_POS (Z_HOME_DIR < 0 ? Z_MIN_POS : Z_MAX_POS)
180
+  #define Z_HOME_POS TERN(Z_HOME_TO_MIN, Z_MIN_POS, Z_MAX_POS)
181 181
 #endif
182 182
 
183 183
 /**
@@ -798,7 +798,7 @@
798 798
  * X_DUAL_ENDSTOPS endstop reassignment
799 799
  */
800 800
 #if ENABLED(X_DUAL_ENDSTOPS)
801
-  #if X_HOME_DIR > 0
801
+  #if X_HOME_TO_MAX
802 802
     #ifndef X2_MAX_ENDSTOP_INVERTING
803 803
       #if X2_USE_ENDSTOP == _XMIN_
804 804
         #define X2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
@@ -921,7 +921,7 @@
921 921
  * Y_DUAL_ENDSTOPS endstop reassignment
922 922
  */
923 923
 #if ENABLED(Y_DUAL_ENDSTOPS)
924
-  #if Y_HOME_DIR > 0
924
+  #if Y_HOME_TO_MAX
925 925
     #ifndef Y2_MAX_ENDSTOP_INVERTING
926 926
       #if Y2_USE_ENDSTOP == _XMIN_
927 927
         #define Y2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
@@ -1045,7 +1045,7 @@
1045 1045
  */
1046 1046
 #if ENABLED(Z_MULTI_ENDSTOPS)
1047 1047
 
1048
-  #if Z_HOME_DIR > 0
1048
+  #if Z_HOME_TO_MAX
1049 1049
     #ifndef Z2_MAX_ENDSTOP_INVERTING
1050 1050
       #if Z2_USE_ENDSTOP == _XMIN_
1051 1051
         #define Z2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
@@ -1164,7 +1164,7 @@
1164 1164
   #endif
1165 1165
 
1166 1166
   #if NUM_Z_STEPPER_DRIVERS >= 3
1167
-    #if Z_HOME_DIR > 0
1167
+    #if Z_HOME_TO_MAX
1168 1168
       #ifndef Z3_MAX_ENDSTOP_INVERTING
1169 1169
         #if Z3_USE_ENDSTOP == _XMIN_
1170 1170
           #define Z3_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
@@ -1284,7 +1284,7 @@
1284 1284
   #endif
1285 1285
 
1286 1286
   #if NUM_Z_STEPPER_DRIVERS >= 4
1287
-    #if Z_HOME_DIR > 0
1287
+    #if Z_HOME_TO_MAX
1288 1288
       #ifndef Z4_MAX_ENDSTOP_INVERTING
1289 1289
         #if Z4_USE_ENDSTOP == _XMIN_
1290 1290
           #define Z4_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING

+ 23
- 23
Marlin/src/inc/SanityCheck.h View File

@@ -1682,7 +1682,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
1682 1682
  * Allen Key
1683 1683
  * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis.
1684 1684
  */
1685
-#if BOTH(Z_PROBE_ALLEN_KEY, Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && Z_HOME_DIR < 0
1685
+#if ALL(Z_HOME_TO_MIN, Z_PROBE_ALLEN_KEY, Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
1686 1686
   #error "You can't home to a Z min endstop with a Z_PROBE_ALLEN_KEY."
1687 1687
 #endif
1688 1688
 
@@ -1700,7 +1700,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
1700 1700
     #error "DUAL_X_CARRIAGE requires USE_XMAX_PLUG and an X Max Endstop."
1701 1701
   #elif !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS)
1702 1702
     #error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS."
1703
-  #elif X_HOME_DIR != -1 || X2_HOME_DIR != 1
1703
+  #elif X_HOME_TO_MAX || X2_HOME_TO_MIN
1704 1704
     #error "DUAL_X_CARRIAGE requires X_HOME_DIR -1 and X2_HOME_DIR 1."
1705 1705
   #endif
1706 1706
 #endif
@@ -2089,25 +2089,25 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
2089 2089
 
2090 2090
   // Delta and Cartesian use 3 homing endstops
2091 2091
   #if NONE(IS_SCARA, SPI_ENDSTOPS)
2092
-    #if X_HOME_DIR < 0 && DISABLED(USE_XMIN_PLUG)
2092
+    #if X_HOME_TO_MIN && DISABLED(USE_XMIN_PLUG)
2093 2093
       #error "Enable USE_XMIN_PLUG when homing X to MIN."
2094
-    #elif X_HOME_DIR > 0 && DISABLED(USE_XMAX_PLUG)
2094
+    #elif X_HOME_TO_MAX && DISABLED(USE_XMAX_PLUG)
2095 2095
       #error "Enable USE_XMAX_PLUG when homing X to MAX."
2096
-    #elif Y_HOME_DIR < 0 && DISABLED(USE_YMIN_PLUG)
2096
+    #elif Y_HOME_TO_MIN && DISABLED(USE_YMIN_PLUG)
2097 2097
       #error "Enable USE_YMIN_PLUG when homing Y to MIN."
2098
-    #elif Y_HOME_DIR > 0 && DISABLED(USE_YMAX_PLUG)
2098
+    #elif Y_HOME_TO_MAX && DISABLED(USE_YMAX_PLUG)
2099 2099
       #error "Enable USE_YMAX_PLUG when homing Y to MAX."
2100 2100
     #endif
2101 2101
   #endif
2102 2102
 
2103 2103
   // Z homing direction and plug usage flags
2104
-  #if Z_HOME_DIR < 0 && NONE(USE_ZMIN_PLUG, HOMING_Z_WITH_PROBE)
2104
+  #if Z_HOME_TO_MIN && NONE(USE_ZMIN_PLUG, HOMING_Z_WITH_PROBE)
2105 2105
     #error "Enable USE_ZMIN_PLUG when homing Z to MIN."
2106
-  #elif Z_HOME_DIR > 0 && ENABLED(USE_PROBE_FOR_Z_HOMING)
2106
+  #elif Z_HOME_TO_MAX && ENABLED(USE_PROBE_FOR_Z_HOMING)
2107 2107
     #error "Z_HOME_DIR must be -1 when homing Z with the probe."
2108 2108
   #elif BOTH(HOMING_Z_WITH_PROBE, Z_MULTI_ENDSTOPS)
2109 2109
     #error "Z_MULTI_ENDSTOPS is incompatible with USE_PROBE_FOR_Z_HOMING."
2110
-  #elif Z_HOME_DIR > 0 && DISABLED(USE_ZMAX_PLUG)
2110
+  #elif Z_HOME_TO_MAX && DISABLED(USE_ZMAX_PLUG)
2111 2111
     #error "Enable USE_ZMAX_PLUG when homing Z to MAX."
2112 2112
   #endif
2113 2113
 #endif
@@ -2630,17 +2630,17 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
2630 2630
   #define Z_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Z,TMC2209)
2631 2631
 
2632 2632
   #if NONE(SPI_ENDSTOPS, ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS)
2633
-    #if   X_SENSORLESS && X_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUP_XMIN)
2633
+    #if   X_SENSORLESS && X_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_XMIN)
2634 2634
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMIN (or ENDSTOPPULLUPS) when homing to X_MIN."
2635
-    #elif X_SENSORLESS && X_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUP_XMAX)
2635
+    #elif X_SENSORLESS && X_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_XMAX)
2636 2636
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMAX (or ENDSTOPPULLUPS) when homing to X_MAX."
2637
-    #elif Y_SENSORLESS && Y_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUP_YMIN)
2637
+    #elif Y_SENSORLESS && Y_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_YMIN)
2638 2638
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMIN (or ENDSTOPPULLUPS) when homing to Y_MIN."
2639
-    #elif Y_SENSORLESS && Y_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUP_YMAX)
2639
+    #elif Y_SENSORLESS && Y_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_YMAX)
2640 2640
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMAX (or ENDSTOPPULLUPS) when homing to Y_MAX."
2641
-    #elif Z_SENSORLESS && Z_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUP_ZMIN)
2641
+    #elif Z_SENSORLESS && Z_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_ZMIN)
2642 2642
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMIN (or ENDSTOPPULLUPS) when homing to Z_MIN."
2643
-    #elif Z_SENSORLESS && Z_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUP_ZMAX)
2643
+    #elif Z_SENSORLESS && Z_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_ZMAX)
2644 2644
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMAX (or ENDSTOPPULLUPS) when homing to Z_MAX."
2645 2645
     #endif
2646 2646
   #endif
@@ -2650,37 +2650,37 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
2650 2650
       #warning "SPI_ENDSTOPS may be unreliable with QUICK_HOME. Adjust back-offs for better results."
2651 2651
     #endif
2652 2652
   #else
2653
-    #if X_SENSORLESS && X_HOME_DIR < 0 && X_MIN_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING
2653
+    #if X_SENSORLESS && X_HOME_TO_MIN && X_MIN_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING
2654 2654
       #if X_ENDSTOP_INVERTING
2655 2655
         #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = true when homing to X_MIN."
2656 2656
       #else
2657 2657
         #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to X_MIN."
2658 2658
       #endif
2659
-    #elif X_SENSORLESS && X_HOME_DIR > 0 && X_MAX_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING
2659
+    #elif X_SENSORLESS && X_HOME_TO_MAX && X_MAX_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING
2660 2660
       #if X_ENDSTOP_INVERTING
2661 2661
         #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING = true when homing to X_MAX."
2662 2662
       #else
2663 2663
         #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to X_MAX."
2664 2664
       #endif
2665
-    #elif Y_SENSORLESS && Y_HOME_DIR < 0 && Y_MIN_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING
2665
+    #elif Y_SENSORLESS && Y_HOME_TO_MIN && Y_MIN_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING
2666 2666
       #if Y_ENDSTOP_INVERTING
2667 2667
         #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING = true when homing to Y_MIN."
2668 2668
       #else
2669 2669
         #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to Y_MIN."
2670 2670
       #endif
2671
-    #elif Y_SENSORLESS && Y_HOME_DIR > 0 && Y_MAX_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING
2671
+    #elif Y_SENSORLESS && Y_HOME_TO_MAX && Y_MAX_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING
2672 2672
       #if Y_ENDSTOP_INVERTING
2673 2673
         #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING = true when homing to Y_MAX."
2674 2674
       #else
2675 2675
         #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Y_MAX."
2676 2676
       #endif
2677
-    #elif Z_SENSORLESS && Z_HOME_DIR < 0 && Z_MIN_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING
2677
+    #elif Z_SENSORLESS && Z_HOME_TO_MIN && Z_MIN_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING
2678 2678
       #if Z_ENDSTOP_INVERTING
2679 2679
         #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING = true when homing to Z_MIN."
2680 2680
       #else
2681 2681
         #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MIN."
2682 2682
       #endif
2683
-    #elif Z_SENSORLESS && Z_HOME_DIR > 0 && Z_MAX_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING
2683
+    #elif Z_SENSORLESS && Z_HOME_TO_MAX && Z_MAX_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING
2684 2684
       #if Z_ENDSTOP_INVERTING
2685 2685
         #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = true when homing to Z_MAX."
2686 2686
       #else
@@ -2918,9 +2918,9 @@ static_assert(   _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
2918 2918
     #error "POWER_LOSS_RECOVER_ZHOME cannot be used with Z_SAFE_HOMING."
2919 2919
   #elif BOTH(POWER_LOSS_PULLUP, POWER_LOSS_PULLDOWN)
2920 2920
     #error "You can't enable POWER_LOSS_PULLUP and POWER_LOSS_PULLDOWN at the same time."
2921
-  #elif ENABLED(POWER_LOSS_RECOVER_ZHOME) && Z_HOME_DIR > 0
2921
+  #elif ENABLED(POWER_LOSS_RECOVER_ZHOME) && Z_HOME_TO_MAX
2922 2922
     #error "POWER_LOSS_RECOVER_ZHOME is not needed on a machine that homes to ZMAX."
2923
-  #elif BOTH(IS_CARTESIAN, POWER_LOSS_RECOVER_ZHOME) && Z_HOME_DIR < 0 && !defined(POWER_LOSS_ZHOME_POS)
2923
+  #elif BOTH(IS_CARTESIAN, POWER_LOSS_RECOVER_ZHOME) && Z_HOME_TO_MIN && !defined(POWER_LOSS_ZHOME_POS)
2924 2924
     #error "POWER_LOSS_RECOVER_ZHOME requires POWER_LOSS_ZHOME_POS for a Cartesian that homes to ZMIN."
2925 2925
   #endif
2926 2926
 #endif

+ 1
- 1
Marlin/src/lcd/extui/ftdi_eve_touch_ui/screens/move_axis_screen.cpp View File

@@ -66,7 +66,7 @@ void MoveAxisScreen::onRedraw(draw_mode_t what) {
66 66
       w.adjuster( 14, GET_TEXT_F(MSG_AXIS_E4), mydata.e_rel[3], canMove(E3));
67 67
     #endif
68 68
   #endif
69
-  #if Z_HOME_DIR < 0
69
+  #if Z_HOME_TO_MIN
70 70
     w.button(24, GET_TEXT_F(MSG_MOVE_Z_TO_TOP), !axis_should_home(Z_AXIS));
71 71
   #endif
72 72
   w.increments();

+ 2
- 2
Marlin/src/lcd/marlinui.cpp View File

@@ -488,12 +488,12 @@ bool MarlinUI::get_blink() {
488 488
 
489 489
           if (RRK(EN_KEYPAD_MIDDLE))  goto_screen(menu_move);
490 490
 
491
-          #if DISABLED(DELTA) && Z_HOME_DIR < 0
491
+          #if NONE(DELTA, Z_HOME_TO_MAX)
492 492
             if (RRK(EN_KEYPAD_F2))    _reprapworld_keypad_move(Z_AXIS,  1);
493 493
           #endif
494 494
 
495 495
           if (homed) {
496
-            #if ENABLED(DELTA) || Z_HOME_DIR != -1
496
+            #if EITHER(DELTA, Z_HOME_TO_MAX)
497 497
               if (RRK(EN_KEYPAD_F2))  _reprapworld_keypad_move(Z_AXIS,  1);
498 498
             #endif
499 499
             if (RRK(EN_KEYPAD_F3))    _reprapworld_keypad_move(Z_AXIS, -1);

+ 8
- 14
Marlin/src/module/endstops.cpp View File

@@ -513,14 +513,8 @@ void Endstops::update() {
513 513
   #endif
514 514
 
515 515
   // With Dual X, endstops are only checked in the homing direction for the active extruder
516
-  #if ENABLED(DUAL_X_CARRIAGE)
517
-    #define E0_ACTIVE stepper.last_moved_extruder == 0
518
-    #define X_MIN_TEST() ((X_HOME_DIR < 0 && E0_ACTIVE) || (X2_HOME_DIR < 0 && !E0_ACTIVE))
519
-    #define X_MAX_TEST() ((X_HOME_DIR > 0 && E0_ACTIVE) || (X2_HOME_DIR > 0 && !E0_ACTIVE))
520
-  #else
521
-    #define X_MIN_TEST() true
522
-    #define X_MAX_TEST() true
523
-  #endif
516
+  #define X_MIN_TEST() TERN1(DUAL_X_CARRIAGE, TERN0(X_HOME_TO_MIN, stepper.last_moved_extruder == 0) || TERN0(X2_HOME_TO_MIN, stepper.last_moved_extruder != 0))
517
+  #define X_MAX_TEST() TERN1(DUAL_X_CARRIAGE, TERN0(X_HOME_TO_MAX, stepper.last_moved_extruder == 0) || TERN0(X2_HOME_TO_MAX, stepper.last_moved_extruder != 0))
524 518
 
525 519
   // Use HEAD for core axes, AXIS for others
526 520
   #if ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY)
@@ -765,7 +759,7 @@ void Endstops::update() {
765 759
 
766 760
   if (stepper.axis_is_moving(X_AXIS)) {
767 761
     if (stepper.motor_direction(X_AXIS_HEAD)) { // -direction
768
-      #if HAS_X_MIN || (X_SPI_SENSORLESS && X_HOME_DIR < 0)
762
+      #if HAS_X_MIN || (X_SPI_SENSORLESS && X_HOME_TO_MIN)
769 763
         PROCESS_ENDSTOP_X(MIN);
770 764
         #if   CORE_DIAG(XY, Y, MIN)
771 765
           PROCESS_CORE_ENDSTOP(Y,MIN,X,MIN);
@@ -779,7 +773,7 @@ void Endstops::update() {
779 773
       #endif
780 774
     }
781 775
     else { // +direction
782
-      #if HAS_X_MAX || (X_SPI_SENSORLESS && X_HOME_DIR > 0)
776
+      #if HAS_X_MAX || (X_SPI_SENSORLESS && X_HOME_TO_MAX)
783 777
         PROCESS_ENDSTOP_X(MAX);
784 778
         #if   CORE_DIAG(XY, Y, MIN)
785 779
           PROCESS_CORE_ENDSTOP(Y,MIN,X,MAX);
@@ -796,7 +790,7 @@ void Endstops::update() {
796 790
 
797 791
   if (stepper.axis_is_moving(Y_AXIS)) {
798 792
     if (stepper.motor_direction(Y_AXIS_HEAD)) { // -direction
799
-      #if HAS_Y_MIN || (Y_SPI_SENSORLESS && Y_HOME_DIR < 0)
793
+      #if HAS_Y_MIN || (Y_SPI_SENSORLESS && Y_HOME_TO_MIN)
800 794
         PROCESS_ENDSTOP_Y(MIN);
801 795
         #if   CORE_DIAG(XY, X, MIN)
802 796
           PROCESS_CORE_ENDSTOP(X,MIN,Y,MIN);
@@ -810,7 +804,7 @@ void Endstops::update() {
810 804
       #endif
811 805
     }
812 806
     else { // +direction
813
-      #if HAS_Y_MAX || (Y_SPI_SENSORLESS && Y_HOME_DIR > 0)
807
+      #if HAS_Y_MAX || (Y_SPI_SENSORLESS && Y_HOME_TO_MAX)
814 808
         PROCESS_ENDSTOP_Y(MAX);
815 809
         #if   CORE_DIAG(XY, X, MIN)
816 810
           PROCESS_CORE_ENDSTOP(X,MIN,Y,MAX);
@@ -828,7 +822,7 @@ void Endstops::update() {
828 822
   if (stepper.axis_is_moving(Z_AXIS)) {
829 823
     if (stepper.motor_direction(Z_AXIS_HEAD)) { // Z -direction. Gantry down, bed up.
830 824
 
831
-      #if HAS_Z_MIN || (Z_SPI_SENSORLESS && Z_HOME_DIR < 0)
825
+      #if HAS_Z_MIN || (Z_SPI_SENSORLESS && Z_HOME_TO_MIN)
832 826
         if ( TERN1(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, z_probe_enabled)
833 827
           && TERN1(HAS_CUSTOM_PROBE_PIN, !z_probe_enabled)
834 828
         ) PROCESS_ENDSTOP_Z(MIN);
@@ -849,7 +843,7 @@ void Endstops::update() {
849 843
       #endif
850 844
     }
851 845
     else { // Z +direction. Gantry up, bed down.
852
-      #if HAS_Z_MAX || (Z_SPI_SENSORLESS && Z_HOME_DIR > 0)
846
+      #if HAS_Z_MAX || (Z_SPI_SENSORLESS && Z_HOME_TO_MAX)
853 847
         #if ENABLED(Z_MULTI_ENDSTOPS)
854 848
           PROCESS_ENDSTOP_Z(MAX);
855 849
         #elif !HAS_CUSTOM_PROBE_PIN || Z_MAX_PIN != Z_MIN_PROBE_PIN  // No probe or probe is Z_MIN || Probe is not Z_MAX

+ 3
- 3
Marlin/src/module/endstops.h View File

@@ -62,9 +62,9 @@ enum EndstopEnum : char {
62 62
   NUM_ENDSTOP_STATES
63 63
 };
64 64
 
65
-#define X_ENDSTOP (x_home_dir(active_extruder) < 0 ? X_MIN : X_MAX)
66
-#define Y_ENDSTOP (Y_HOME_DIR < 0 ? Y_MIN : Y_MAX)
67
-#define Z_ENDSTOP (Z_HOME_DIR < 0 ? TERN(HOMING_Z_WITH_PROBE, Z_MIN, Z_MIN_PROBE) : Z_MAX)
65
+#define X_ENDSTOP TERN(X_HOME_TO_MAX, X_MAX, X_MIN)
66
+#define Y_ENDSTOP TERN(Y_HOME_TO_MAX, Y_MAX, Y_MIN)
67
+#define Z_ENDSTOP TERN(Z_HOME_TO_MAX, Z_MAX, TERN(HOMING_Z_WITH_PROBE, Z_MIN, Z_MIN_PROBE))
68 68
 
69 69
 #undef __ES_ITEM
70 70
 #undef _ES_ITEM

+ 5
- 5
Marlin/src/module/motion.cpp View File

@@ -1378,7 +1378,7 @@ void prepare_line_to_destination() {
1378 1378
 
1379 1379
     // Only do some things when moving towards an endstop
1380 1380
     const int8_t axis_home_dir = TERN0(DUAL_X_CARRIAGE, axis == X_AXIS)
1381
-                  ? x_home_dir(active_extruder) : home_dir(axis);
1381
+                  ? TOOL_X_HOME_DIR(active_extruder) : home_dir(axis);
1382 1382
     const bool is_home_dir = (axis_home_dir > 0) == (distance > 0);
1383 1383
 
1384 1384
     #if ENABLED(SENSORLESS_HOMING)
@@ -1562,8 +1562,8 @@ void prepare_line_to_destination() {
1562 1562
       #define _CAN_HOME(A) (axis == _AXIS(A) && ( \
1563 1563
            ENABLED(A##_SPI_SENSORLESS) \
1564 1564
         || (_AXIS(A) == Z_AXIS && ENABLED(HOMING_Z_WITH_PROBE)) \
1565
-        || (A##_MIN_PIN > -1 && A##_HOME_DIR < 0) \
1566
-        || (A##_MAX_PIN > -1 && A##_HOME_DIR > 0) \
1565
+        || TERN0(A##_HOME_TO_MIN, A##_MIN_PIN > -1) \
1566
+        || TERN0(A##_HOME_TO_MAX, A##_MAX_PIN > -1) \
1567 1567
       ))
1568 1568
       if (!_CAN_HOME(X) && !_CAN_HOME(Y) && !_CAN_HOME(Z)) return;
1569 1569
     #endif
@@ -1571,7 +1571,7 @@ void prepare_line_to_destination() {
1571 1571
     if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR(">>> homeaxis(", AS_CHAR(axis_codes[axis]), ")");
1572 1572
 
1573 1573
     const int axis_home_dir = TERN0(DUAL_X_CARRIAGE, axis == X_AXIS)
1574
-                ? x_home_dir(active_extruder) : home_dir(axis);
1574
+                ? TOOL_X_HOME_DIR(active_extruder) : home_dir(axis);
1575 1575
 
1576 1576
     //
1577 1577
     // Homing Z with a probe? Raise Z (maybe) and deploy the Z probe.
@@ -1916,7 +1916,7 @@ void set_axis_is_at_home(const AxisEnum axis) {
1916 1916
   /**
1917 1917
    * Z Probe Z Homing? Account for the probe's Z offset.
1918 1918
    */
1919
-  #if HAS_BED_PROBE && Z_HOME_DIR < 0
1919
+  #if HAS_BED_PROBE && Z_HOME_TO_MIN
1920 1920
     if (axis == Z_AXIS) {
1921 1921
       #if HOMING_Z_WITH_PROBE
1922 1922
 

+ 2
- 2
Marlin/src/module/motion.h View File

@@ -517,7 +517,7 @@ FORCE_INLINE bool all_axes_trusted()                        { return linear_bits
517 517
 
518 518
   float x_home_pos(const uint8_t extruder);
519 519
 
520
-  FORCE_INLINE int x_home_dir(const uint8_t extruder) { return extruder ? X2_HOME_DIR : X_HOME_DIR; }
520
+  #define TOOL_X_HOME_DIR(T) ((T) ? X2_HOME_DIR : X_HOME_DIR)
521 521
 
522 522
   void set_duplication_enabled(const bool dupe, const int8_t tool_index=-1);
523 523
   void idex_set_mirrored_mode(const bool mirr);
@@ -531,7 +531,7 @@ FORCE_INLINE bool all_axes_trusted()                        { return linear_bits
531 531
     FORCE_INLINE void set_duplication_enabled(const bool dupe) { extruder_duplication_enabled = dupe; }
532 532
   #endif
533 533
 
534
-  FORCE_INLINE int x_home_dir(const uint8_t) { return X_HOME_DIR; }
534
+  #define TOOL_X_HOME_DIR(T) X_HOME_DIR
535 535
 
536 536
 #endif
537 537
 

+ 3
- 3
Marlin/src/module/scara.cpp View File

@@ -221,10 +221,10 @@ float segments_per_second = TERN(AXEL_TPARA, TPARA_SEGMENTS_PER_SECOND, SCARA_SE
221 221
       TERN_(Z_SENSORLESS, sensorless_t stealth_states_z = start_sensorless_homing_per_axis(Z_AXIS));
222 222
     #endif
223 223
 
224
-    // const int x_axis_home_dir = x_home_dir(active_extruder);
224
+    //const int x_axis_home_dir = TOOL_X_HOME_DIR(active_extruder);
225 225
 
226
-    // const xy_pos_t pos { max_length(X_AXIS) , max_length(Y_AXIS) };
227
-    // const float mlz = max_length(X_AXIS),
226
+    //const xy_pos_t pos { max_length(X_AXIS) , max_length(Y_AXIS) };
227
+    //const float mlz = max_length(X_AXIS),
228 228
 
229 229
     // Move all carriages together linearly until an endstop is hit.
230 230
     //do_blocking_move_to_xy_z(pos, mlz, homing_feedrate(Z_AXIS));

+ 3
- 3
Marlin/src/module/stepper.cpp View File

@@ -259,7 +259,7 @@ xyze_int8_t Stepper::count_direction{0};
259 259
 
260 260
 #define DUAL_ENDSTOP_APPLY_STEP(A,V)                                                                                        \
261 261
   if (separate_multi_axis) {                                                                                                \
262
-    if (A##_HOME_DIR < 0) {                                                                                                 \
262
+    if (A##_HOME_TO_MIN) {                                                                                                  \
263 263
       if (TERN0(HAS_##A##_MIN, !(TEST(endstops.state(), A##_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##_motor)) A##_STEP_WRITE(V);     \
264 264
       if (TERN0(HAS_##A##2_MIN, !(TEST(endstops.state(), A##2_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##2_motor)) A##2_STEP_WRITE(V); \
265 265
     }                                                                                                                       \
@@ -285,7 +285,7 @@ xyze_int8_t Stepper::count_direction{0};
285 285
 
286 286
 #define TRIPLE_ENDSTOP_APPLY_STEP(A,V)                                                                                      \
287 287
   if (separate_multi_axis) {                                                                                                \
288
-    if (A##_HOME_DIR < 0) {                                                                                                 \
288
+    if (A##_HOME_TO_MIN) {                                                                                                  \
289 289
       if (!(TEST(endstops.state(), A##_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##_motor) A##_STEP_WRITE(V);    \
290 290
       if (!(TEST(endstops.state(), A##2_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##2_motor) A##2_STEP_WRITE(V); \
291 291
       if (!(TEST(endstops.state(), A##3_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##3_motor) A##3_STEP_WRITE(V); \
@@ -316,7 +316,7 @@ xyze_int8_t Stepper::count_direction{0};
316 316
 
317 317
 #define QUAD_ENDSTOP_APPLY_STEP(A,V)                                                                                        \
318 318
   if (separate_multi_axis) {                                                                                                \
319
-    if (A##_HOME_DIR < 0) {                                                                                                 \
319
+    if (A##_HOME_TO_MIN) {                                                                                                  \
320 320
       if (!(TEST(endstops.state(), A##_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##_motor) A##_STEP_WRITE(V);    \
321 321
       if (!(TEST(endstops.state(), A##2_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##2_motor) A##2_STEP_WRITE(V); \
322 322
       if (!(TEST(endstops.state(), A##3_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##3_motor) A##3_STEP_WRITE(V); \

+ 3
- 3
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h View File

@@ -38,7 +38,7 @@
38 38
 //
39 39
 #ifdef X_STALL_SENSITIVITY
40 40
   #define X_STOP_PIN                  X_DIAG_PIN
41
-  #if X_HOME_DIR < 0
41
+  #if X_HOME_TO_MIN
42 42
     #define X_MAX_PIN                      P1_28  // X+
43 43
   #else
44 44
     #define X_MIN_PIN                      P1_28  // X+
@@ -50,7 +50,7 @@
50 50
 
51 51
 #ifdef Y_STALL_SENSITIVITY
52 52
   #define Y_STOP_PIN                  Y_DIAG_PIN
53
-  #if Y_HOME_DIR < 0
53
+  #if Y_HOME_TO_MIN
54 54
     #define Y_MAX_PIN                      P1_26  // Y+
55 55
   #else
56 56
     #define Y_MIN_PIN                      P1_26  // Y+
@@ -62,7 +62,7 @@
62 62
 
63 63
 #ifdef Z_STALL_SENSITIVITY
64 64
   #define Z_STOP_PIN                  Z_DIAG_PIN
65
-  #if Z_HOME_DIR < 0
65
+  #if Z_HOME_TO_MIN
66 66
     #define Z_MAX_PIN                      P1_24  // Z+
67 67
   #else
68 68
     #define Z_MIN_PIN                      P1_24  // Z+

+ 3
- 3
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h View File

@@ -50,7 +50,7 @@
50 50
 //
51 51
 #ifdef X_STALL_SENSITIVITY
52 52
   #define X_STOP_PIN                  X_DIAG_PIN
53
-  #if X_HOME_DIR < 0
53
+  #if X_HOME_TO_MIN
54 54
     #define X_MAX_PIN                      P1_26  // E0DET
55 55
   #else
56 56
     #define X_MIN_PIN                      P1_26  // E0DET
@@ -68,7 +68,7 @@
68 68
 
69 69
 #ifdef Y_STALL_SENSITIVITY
70 70
   #define Y_STOP_PIN                  Y_DIAG_PIN
71
-  #if Y_HOME_DIR < 0
71
+  #if Y_HOME_TO_MIN
72 72
     #define Y_MAX_PIN                      P1_25  // E1DET
73 73
   #else
74 74
     #define Y_MIN_PIN                      P1_25  // E1DET
@@ -86,7 +86,7 @@
86 86
 
87 87
 #ifdef Z_STALL_SENSITIVITY
88 88
   #define Z_STOP_PIN                  Z_DIAG_PIN
89
-  #if Z_HOME_DIR < 0
89
+  #if Z_HOME_TO_MIN
90 90
     #define Z_MAX_PIN                      P1_00  // PWRDET
91 91
   #else
92 92
     #define Z_MIN_PIN                      P1_00  // PWRDET

+ 3
- 3
Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h View File

@@ -50,7 +50,7 @@
50 50
 //
51 51
 #ifdef X_STALL_SENSITIVITY
52 52
   #define X_STOP_PIN                  X_DIAG_PIN
53
-  #if X_HOME_DIR < 0
53
+  #if X_HOME_TO_MIN
54 54
     #define X_MAX_PIN                      P1_28  // X+
55 55
   #else
56 56
     #define X_MIN_PIN                      P1_28  // X+
@@ -62,7 +62,7 @@
62 62
 
63 63
 #ifdef Y_STALL_SENSITIVITY
64 64
   #define Y_STOP_PIN                  Y_DIAG_PIN
65
-  #if Y_HOME_DIR < 0
65
+  #if Y_HOME_TO_MIN
66 66
     #define Y_MAX_PIN                      P1_26  // Y+
67 67
   #else
68 68
     #define Y_MIN_PIN                      P1_26  // Y+
@@ -74,7 +74,7 @@
74 74
 
75 75
 #ifdef Z_STALL_SENSITIVITY
76 76
   #define Z_STOP_PIN                  Z_DIAG_PIN
77
-  #if Z_HOME_DIR < 0
77
+  #if Z_HOME_TO_MIN
78 78
     #define Z_MAX_PIN                      P1_24  // Z+
79 79
   #else
80 80
     #define Z_MIN_PIN                      P1_24  // Z+

+ 3
- 3
Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h View File

@@ -60,7 +60,7 @@
60 60
 //
61 61
 #if X_STALL_SENSITIVITY
62 62
   #define X_STOP_PIN                  X_DIAG_PIN
63
-  #if X_HOME_DIR < 0
63
+  #if X_HOME_TO_MIN
64 64
     #define X_MAX_PIN                      P1_28  // X+
65 65
   #else
66 66
     #define X_MIN_PIN                      P1_28  // X+
@@ -72,7 +72,7 @@
72 72
 
73 73
 #if Y_STALL_SENSITIVITY
74 74
   #define Y_STOP_PIN                  Y_DIAG_PIN
75
-  #if Y_HOME_DIR < 0
75
+  #if Y_HOME_TO_MIN
76 76
     #define Y_MAX_PIN                      P1_26  // Y+
77 77
   #else
78 78
     #define Y_MIN_PIN                      P1_26  // Y+
@@ -84,7 +84,7 @@
84 84
 
85 85
 #if Z_STALL_SENSITIVITY
86 86
   #define Z_STOP_PIN                  Z_DIAG_PIN
87
-  #if Z_HOME_DIR < 0
87
+  #if Z_HOME_TO_MIN
88 88
     #define Z_MAX_PIN                      P1_24  // Z+
89 89
   #else
90 90
     #define Z_MIN_PIN                      P1_24  // Z+

+ 16
- 16
Marlin/src/pins/pins_postprocess.h View File

@@ -385,7 +385,7 @@
385 385
 // Assign endstop pins for boards with only 3 connectors
386 386
 //
387 387
 #ifdef X_STOP_PIN
388
-  #if X_HOME_DIR < 0
388
+  #if X_HOME_TO_MIN
389 389
     #define X_MIN_PIN X_STOP_PIN
390 390
     #ifndef X_MAX_PIN
391 391
       #define X_MAX_PIN -1
@@ -396,14 +396,14 @@
396 396
       #define X_MIN_PIN -1
397 397
     #endif
398 398
   #endif
399
-#elif X_HOME_DIR < 0
399
+#elif X_HOME_TO_MIN
400 400
   #define X_STOP_PIN X_MIN_PIN
401 401
 #else
402 402
   #define X_STOP_PIN X_MAX_PIN
403 403
 #endif
404 404
 
405 405
 #ifdef Y_STOP_PIN
406
-  #if Y_HOME_DIR < 0
406
+  #if Y_HOME_TO_MIN
407 407
     #define Y_MIN_PIN Y_STOP_PIN
408 408
     #ifndef Y_MAX_PIN
409 409
       #define Y_MAX_PIN -1
@@ -414,14 +414,14 @@
414 414
       #define Y_MIN_PIN -1
415 415
     #endif
416 416
   #endif
417
-#elif Y_HOME_DIR < 0
417
+#elif Y_HOME_TO_MIN
418 418
   #define Y_STOP_PIN Y_MIN_PIN
419 419
 #else
420 420
   #define Y_STOP_PIN Y_MAX_PIN
421 421
 #endif
422 422
 
423 423
 #ifdef Z_STOP_PIN
424
-  #if Z_HOME_DIR < 0
424
+  #if Z_HOME_TO_MIN
425 425
     #define Z_MIN_PIN Z_STOP_PIN
426 426
     #ifndef Z_MAX_PIN
427 427
       #define Z_MAX_PIN -1
@@ -432,7 +432,7 @@
432 432
       #define Z_MIN_PIN -1
433 433
     #endif
434 434
   #endif
435
-#elif Z_HOME_DIR < 0
435
+#elif Z_HOME_TO_MIN
436 436
   #define Z_STOP_PIN Z_MIN_PIN
437 437
 #else
438 438
   #define Z_STOP_PIN Z_MAX_PIN
@@ -489,34 +489,34 @@
489 489
   #undef Z_MIN_PIN
490 490
   #define Z_MIN_PIN          -1
491 491
 #endif
492
-#if DISABLED(X_DUAL_ENDSTOPS) || X_HOME_DIR > 0
492
+#if DISABLED(X_DUAL_ENDSTOPS) || X_HOME_TO_MAX
493 493
   #undef X2_MIN_PIN
494 494
 #endif
495
-#if DISABLED(X_DUAL_ENDSTOPS) || X_HOME_DIR < 0
495
+#if DISABLED(X_DUAL_ENDSTOPS) || X_HOME_TO_MIN
496 496
   #undef X2_MAX_PIN
497 497
 #endif
498
-#if DISABLED(Y_DUAL_ENDSTOPS) || Y_HOME_DIR > 0
498
+#if DISABLED(Y_DUAL_ENDSTOPS) || Y_HOME_TO_MAX
499 499
   #undef Y2_MIN_PIN
500 500
 #endif
501
-#if DISABLED(Y_DUAL_ENDSTOPS) || Y_HOME_DIR < 0
501
+#if DISABLED(Y_DUAL_ENDSTOPS) || Y_HOME_TO_MIN
502 502
   #undef Y2_MAX_PIN
503 503
 #endif
504
-#if DISABLED(Z_MULTI_ENDSTOPS) || Z_HOME_DIR > 0
504
+#if DISABLED(Z_MULTI_ENDSTOPS) || Z_HOME_TO_MAX
505 505
   #undef Z2_MIN_PIN
506 506
 #endif
507
-#if DISABLED(Z_MULTI_ENDSTOPS) || Z_HOME_DIR < 0
507
+#if DISABLED(Z_MULTI_ENDSTOPS) || Z_HOME_TO_MIN
508 508
   #undef Z2_MAX_PIN
509 509
 #endif
510
-#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 3 || Z_HOME_DIR > 0
510
+#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 3 || Z_HOME_TO_MAX
511 511
   #undef Z3_MIN_PIN
512 512
 #endif
513
-#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 3 || Z_HOME_DIR < 0
513
+#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 3 || Z_HOME_TO_MIN
514 514
   #undef Z3_MAX_PIN
515 515
 #endif
516
-#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 4 || Z_HOME_DIR > 0
516
+#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 4 || Z_HOME_TO_MAX
517 517
   #undef Z4_MIN_PIN
518 518
 #endif
519
-#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 4 || Z_HOME_DIR < 0
519
+#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 4 || Z_HOME_TO_MIN
520 520
   #undef Z4_MAX_PIN
521 521
 #endif
522 522
 

+ 2
- 2
Marlin/src/pins/rambo/pins_EINSY_RETRO.h View File

@@ -61,7 +61,7 @@
61 61
 
62 62
 #else
63 63
 
64
-  #if X_HOME_DIR < 0
64
+  #if X_HOME_TO_MIN
65 65
     #define X_MIN_PIN                 X_DIAG_PIN
66 66
     #define X_MAX_PIN                         81  // X+
67 67
   #else
@@ -69,7 +69,7 @@
69 69
     #define X_MAX_PIN                 X_DIAG_PIN
70 70
   #endif
71 71
 
72
-  #if Y_HOME_DIR < 0
72
+  #if Y_HOME_TO_MIN
73 73
     #define Y_MIN_PIN                 Y_DIAG_PIN
74 74
     #define Y_MAX_PIN                         57  // Y+
75 75
   #else

+ 2
- 2
Marlin/src/pins/sam/pins_ARCHIM2.h View File

@@ -71,7 +71,7 @@
71 71
   #define E0_DIAG_PIN                         78  // PB23
72 72
   #define E1_DIAG_PIN                         25  // PD0
73 73
 
74
-  #if X_HOME_DIR < 0
74
+  #if X_HOME_TO_MIN
75 75
     #define X_MIN_PIN                 X_DIAG_PIN
76 76
     #define X_MAX_PIN                         32
77 77
   #else
@@ -79,7 +79,7 @@
79 79
     #define X_MAX_PIN                 X_DIAG_PIN
80 80
   #endif
81 81
 
82
-  #if Y_HOME_DIR < 0
82
+  #if Y_HOME_TO_MIN
83 83
     #define Y_MIN_PIN                 Y_DIAG_PIN
84 84
     #define Y_MAX_PIN                         15
85 85
   #else

+ 1
- 1
Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h View File

@@ -55,7 +55,7 @@
55 55
   #define X2_DIR_PIN                   FPC10_PIN  // X2DIR
56 56
   #define X2_SERIAL_TX_PIN             FPC12_PIN  // X2UART
57 57
   #define X2_SERIAL_RX_PIN             FPC12_PIN  // X2UART
58
-  #if X_HOME_DIR < 0
58
+  #if X_HOME_TO_MIN
59 59
     #define X_MAX_PIN                   FPC2_PIN  // X2-STOP
60 60
   #else
61 61
     #define X_MIN_PIN                   FPC2_PIN  // X2-STOP

+ 3
- 3
Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h View File

@@ -69,7 +69,7 @@
69 69
 //
70 70
 #ifdef X_STALL_SENSITIVITY
71 71
   #define X_STOP_PIN                  X_DIAG_PIN
72
-  #if X_HOME_DIR < 0
72
+  #if X_HOME_TO_MIN
73 73
     #define X_MAX_PIN                E0_DIAG_PIN  // X+
74 74
   #else
75 75
     #define X_MIN_PIN                E0_DIAG_PIN  // X+
@@ -81,7 +81,7 @@
81 81
 
82 82
 #ifdef Y_STALL_SENSITIVITY
83 83
   #define Y_STOP_PIN                  Y_DIAG_PIN
84
-  #if Y_HOME_DIR < 0
84
+  #if Y_HOME_TO_MIN
85 85
     #define Y_MAX_PIN                E1_DIAG_PIN  // Y+
86 86
   #else
87 87
     #define Y_MIN_PIN                E1_DIAG_PIN  // Y+
@@ -93,7 +93,7 @@
93 93
 
94 94
 #ifdef Z_STALL_SENSITIVITY
95 95
   #define Z_STOP_PIN                  Z_DIAG_PIN
96
-  #if Z_HOME_DIR < 0
96
+  #if Z_HOME_TO_MIN
97 97
     #define Z_MAX_PIN                E2_DIAG_PIN  // Z+
98 98
   #else
99 99
     #define Z_MIN_PIN                E2_DIAG_PIN  // Z+

+ 3
- 3
Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_0.h View File

@@ -71,7 +71,7 @@
71 71
 //
72 72
 #ifdef X_STALL_SENSITIVITY
73 73
   #define X_STOP_PIN                  X_DIAG_PIN
74
-  #if X_HOME_DIR < 0
74
+  #if X_HOME_TO_MIN
75 75
     #define X_MAX_PIN                E0_DIAG_PIN  // E0DET
76 76
   #else
77 77
     #define X_MIN_PIN                E0_DIAG_PIN  // E0DET
@@ -89,7 +89,7 @@
89 89
 
90 90
 #ifdef Y_STALL_SENSITIVITY
91 91
   #define Y_STOP_PIN                  Y_DIAG_PIN
92
-  #if Y_HOME_DIR < 0
92
+  #if Y_HOME_TO_MIN
93 93
     #define Y_MAX_PIN                E1_DIAG_PIN  // E1DET
94 94
   #else
95 95
     #define Y_MIN_PIN                E1_DIAG_PIN  // E1DET
@@ -107,7 +107,7 @@
107 107
 
108 108
 #ifdef Z_STALL_SENSITIVITY
109 109
   #define Z_STOP_PIN                  Z_DIAG_PIN
110
-  #if Z_HOME_DIR < 0
110
+  #if Z_HOME_TO_MIN
111 111
     #define Z_MAX_PIN                E2_DIAG_PIN  // PWRDET
112 112
   #else
113 113
     #define Z_MIN_PIN                E2_DIAG_PIN  // PWRDET

+ 3
- 3
Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h View File

@@ -71,7 +71,7 @@
71 71
 //
72 72
 #ifdef X_STALL_SENSITIVITY
73 73
   #define X_STOP_PIN                  X_DIAG_PIN
74
-  #if X_HOME_DIR < 0
74
+  #if X_HOME_TO_MIN
75 75
     #define X_MAX_PIN                       PE15  // E0
76 76
   #else
77 77
     #define X_MIN_PIN                       PE15  // E0
@@ -83,7 +83,7 @@
83 83
 
84 84
 #ifdef Y_STALL_SENSITIVITY
85 85
   #define Y_STOP_PIN                  Y_DIAG_PIN
86
-  #if Y_HOME_DIR < 0
86
+  #if Y_HOME_TO_MIN
87 87
     #define Y_MAX_PIN                       PE10  // E1
88 88
   #else
89 89
     #define Y_MIN_PIN                       PE10  // E1
@@ -95,7 +95,7 @@
95 95
 
96 96
 #ifdef Z_STALL_SENSITIVITY
97 97
   #define Z_STOP_PIN                  Z_DIAG_PIN
98
-  #if Z_HOME_DIR < 0
98
+  #if Z_HOME_TO_MIN
99 99
     #define Z_MAX_PIN                       PG5   // E2
100 100
   #else
101 101
     #define Z_MIN_PIN                       PG5   // E2

+ 3
- 3
Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h View File

@@ -72,7 +72,7 @@
72 72
 //
73 73
 #ifdef X_STALL_SENSITIVITY
74 74
   #define X_STOP_PIN                  X_DIAG_PIN
75
-  #if X_HOME_DIR < 0
75
+  #if X_HOME_TO_MIN
76 76
     #define X_MAX_PIN                       PC2   // E0DET
77 77
   #else
78 78
     #define X_MIN_PIN                       PC2   // E0DET
@@ -90,7 +90,7 @@
90 90
 
91 91
 #ifdef Y_STALL_SENSITIVITY
92 92
   #define Y_STOP_PIN                  Y_DIAG_PIN
93
-  #if Y_HOME_DIR < 0
93
+  #if Y_HOME_TO_MIN
94 94
     #define Y_MAX_PIN                       PA0   // E1DET
95 95
   #else
96 96
     #define Y_MIN_PIN                       PA0   // E1DET
@@ -108,7 +108,7 @@
108 108
 
109 109
 #ifdef Z_STALL_SENSITIVITY
110 110
   #define Z_STOP_PIN                  Z_DIAG_PIN
111
-  #if Z_HOME_DIR < 0
111
+  #if Z_HOME_TO_MIN
112 112
     #define Z_MAX_PIN                       PC15  // PWRDET
113 113
   #else
114 114
     #define Z_MIN_PIN                       PC15  // PWRDET

Loading…
Cancel
Save