Browse Source

🎨 Various multi-axis patches (#22823)

Scott Lahteine 3 years ago
parent
commit
dc5bef62ba
No account linked to committer's email address

+ 12
- 12
Marlin/Configuration.h View File

794
 #define ENDSTOPPULLUPS
794
 #define ENDSTOPPULLUPS
795
 #if DISABLED(ENDSTOPPULLUPS)
795
 #if DISABLED(ENDSTOPPULLUPS)
796
   // Disable ENDSTOPPULLUPS to set pullups individually
796
   // Disable ENDSTOPPULLUPS to set pullups individually
797
-  //#define ENDSTOPPULLUP_XMAX
798
-  //#define ENDSTOPPULLUP_YMAX
799
-  //#define ENDSTOPPULLUP_ZMAX
800
-  //#define ENDSTOPPULLUP_IMAX
801
-  //#define ENDSTOPPULLUP_JMAX
802
-  //#define ENDSTOPPULLUP_KMAX
803
   //#define ENDSTOPPULLUP_XMIN
797
   //#define ENDSTOPPULLUP_XMIN
804
   //#define ENDSTOPPULLUP_YMIN
798
   //#define ENDSTOPPULLUP_YMIN
805
   //#define ENDSTOPPULLUP_ZMIN
799
   //#define ENDSTOPPULLUP_ZMIN
806
   //#define ENDSTOPPULLUP_IMIN
800
   //#define ENDSTOPPULLUP_IMIN
807
   //#define ENDSTOPPULLUP_JMIN
801
   //#define ENDSTOPPULLUP_JMIN
808
   //#define ENDSTOPPULLUP_KMIN
802
   //#define ENDSTOPPULLUP_KMIN
803
+  //#define ENDSTOPPULLUP_XMAX
804
+  //#define ENDSTOPPULLUP_YMAX
805
+  //#define ENDSTOPPULLUP_ZMAX
806
+  //#define ENDSTOPPULLUP_IMAX
807
+  //#define ENDSTOPPULLUP_JMAX
808
+  //#define ENDSTOPPULLUP_KMAX
809
   //#define ENDSTOPPULLUP_ZMIN_PROBE
809
   //#define ENDSTOPPULLUP_ZMIN_PROBE
810
 #endif
810
 #endif
811
 
811
 
813
 //#define ENDSTOPPULLDOWNS
813
 //#define ENDSTOPPULLDOWNS
814
 #if DISABLED(ENDSTOPPULLDOWNS)
814
 #if DISABLED(ENDSTOPPULLDOWNS)
815
   // Disable ENDSTOPPULLDOWNS to set pulldowns individually
815
   // Disable ENDSTOPPULLDOWNS to set pulldowns individually
816
-  //#define ENDSTOPPULLDOWN_XMAX
817
-  //#define ENDSTOPPULLDOWN_YMAX
818
-  //#define ENDSTOPPULLDOWN_ZMAX
819
-  //#define ENDSTOPPULLDOWN_IMAX
820
-  //#define ENDSTOPPULLDOWN_JMAX
821
-  //#define ENDSTOPPULLDOWN_KMAX
822
   //#define ENDSTOPPULLDOWN_XMIN
816
   //#define ENDSTOPPULLDOWN_XMIN
823
   //#define ENDSTOPPULLDOWN_YMIN
817
   //#define ENDSTOPPULLDOWN_YMIN
824
   //#define ENDSTOPPULLDOWN_ZMIN
818
   //#define ENDSTOPPULLDOWN_ZMIN
825
   //#define ENDSTOPPULLDOWN_IMIN
819
   //#define ENDSTOPPULLDOWN_IMIN
826
   //#define ENDSTOPPULLDOWN_JMIN
820
   //#define ENDSTOPPULLDOWN_JMIN
827
   //#define ENDSTOPPULLDOWN_KMIN
821
   //#define ENDSTOPPULLDOWN_KMIN
822
+  //#define ENDSTOPPULLDOWN_XMAX
823
+  //#define ENDSTOPPULLDOWN_YMAX
824
+  //#define ENDSTOPPULLDOWN_ZMAX
825
+  //#define ENDSTOPPULLDOWN_IMAX
826
+  //#define ENDSTOPPULLDOWN_JMAX
827
+  //#define ENDSTOPPULLDOWN_KMAX
828
   //#define ENDSTOPPULLDOWN_ZMIN_PROBE
828
   //#define ENDSTOPPULLDOWN_ZMIN_PROBE
829
 #endif
829
 #endif
830
 
830
 

+ 8
- 4
Marlin/src/HAL/SAMD51/endstop_interrupts.h View File

162
       #error "Z_MIN_PROBE_PIN has no EXTINT line available."
162
       #error "Z_MIN_PROBE_PIN has no EXTINT line available."
163
     #endif
163
     #endif
164
     _ATTACH(Z_MIN_PROBE_PIN);
164
     _ATTACH(Z_MIN_PROBE_PIN);
165
-  #elif HAS_I_MAX
165
+  #endif
166
+  #if HAS_I_MAX
166
     #if !AVAILABLE_EILINE(I_MAX_PIN)
167
     #if !AVAILABLE_EILINE(I_MAX_PIN)
167
       #error "I_MAX_PIN has no EXTINT line available."
168
       #error "I_MAX_PIN has no EXTINT line available."
168
     #endif
169
     #endif
169
     attachInterrupt(I_MAX_PIN, endstop_ISR, CHANGE);
170
     attachInterrupt(I_MAX_PIN, endstop_ISR, CHANGE);
170
-  #elif HAS_I_MIN
171
+  #endif
172
+  #if HAS_I_MIN
171
     #if !AVAILABLE_EILINE(I_MIN_PIN)
173
     #if !AVAILABLE_EILINE(I_MIN_PIN)
172
       #error "I_MIN_PIN has no EXTINT line available."
174
       #error "I_MIN_PIN has no EXTINT line available."
173
     #endif
175
     #endif
178
       #error "J_MAX_PIN has no EXTINT line available."
180
       #error "J_MAX_PIN has no EXTINT line available."
179
     #endif
181
     #endif
180
     attachInterrupt(J_MAX_PIN, endstop_ISR, CHANGE);
182
     attachInterrupt(J_MAX_PIN, endstop_ISR, CHANGE);
181
-  #elif HAS_J_MIN
183
+  #endif
184
+  #if HAS_J_MIN
182
     #if !AVAILABLE_EILINE(J_MIN_PIN)
185
     #if !AVAILABLE_EILINE(J_MIN_PIN)
183
       #error "J_MIN_PIN has no EXTINT line available."
186
       #error "J_MIN_PIN has no EXTINT line available."
184
     #endif
187
     #endif
189
       #error "K_MAX_PIN has no EXTINT line available."
192
       #error "K_MAX_PIN has no EXTINT line available."
190
     #endif
193
     #endif
191
     attachInterrupt(K_MAX_PIN, endstop_ISR, CHANGE);
194
     attachInterrupt(K_MAX_PIN, endstop_ISR, CHANGE);
192
-  #elif HAS_K_MIN
195
+  #endif
196
+  #if HAS_K_MIN
193
     #if !AVAILABLE_EILINE(K_MIN_PIN)
197
     #if !AVAILABLE_EILINE(K_MIN_PIN)
194
       #error "K_MIN_PIN has no EXTINT line available."
198
       #error "K_MIN_PIN has no EXTINT line available."
195
     #endif
199
     #endif

+ 37
- 26
Marlin/src/core/macros.h View File

33
 
33
 
34
 #define _AXIS(A) (A##_AXIS)
34
 #define _AXIS(A) (A##_AXIS)
35
 
35
 
36
-#define _XMIN_   100
37
-#define _YMIN_   200
38
-#define _ZMIN_   300
39
-#define _IMIN_   500
40
-#define _JMIN_   600
41
-#define _KMIN_   700
42
-#define _XMAX_   101
43
-#define _YMAX_   201
44
-#define _ZMAX_   301
45
-#define _IMAX_   501
46
-#define _JMAX_   601
47
-#define _KMAX_   701
48
-#define _XDIAG_  102
49
-#define _YDIAG_  202
50
-#define _ZDIAG_  302
51
-#define _IDIAG_  502
52
-#define _JDIAG_  602
53
-#define _KDIAG_  702
54
-#define _E0DIAG_ 400
55
-#define _E1DIAG_ 401
56
-#define _E2DIAG_ 402
57
-#define _E3DIAG_ 403
58
-#define _E4DIAG_ 404
59
-#define _E5DIAG_ 405
60
-#define _E6DIAG_ 406
61
-#define _E7DIAG_ 407
36
+#define _XMIN_   0x11
37
+#define _YMIN_   0x12
38
+#define _ZMIN_   0x13
39
+#define _IMIN_   0x14
40
+#define _JMIN_   0x15
41
+#define _KMIN_   0x16
42
+#define _XMAX_   0x21
43
+#define _YMAX_   0x22
44
+#define _ZMAX_   0x23
45
+#define _IMAX_   0x24
46
+#define _JMAX_   0x25
47
+#define _KMAX_   0x26
48
+#define _XDIAG_  0x31
49
+#define _YDIAG_  0x32
50
+#define _ZDIAG_  0x33
51
+#define _IDIAG_  0x34
52
+#define _JDIAG_  0x35
53
+#define _KDIAG_  0x36
54
+#define _E0DIAG_ 0xE0
55
+#define _E1DIAG_ 0xE1
56
+#define _E2DIAG_ 0xE2
57
+#define _E3DIAG_ 0xE3
58
+#define _E4DIAG_ 0xE4
59
+#define _E5DIAG_ 0xE5
60
+#define _E6DIAG_ 0xE6
61
+#define _E7DIAG_ 0xE7
62
 
62
 
63
 #define _FORCE_INLINE_ __attribute__((__always_inline__)) __inline__
63
 #define _FORCE_INLINE_ __attribute__((__always_inline__)) __inline__
64
 #define  FORCE_INLINE  __attribute__((always_inline)) inline
64
 #define  FORCE_INLINE  __attribute__((always_inline)) inline
251
     memcpy(&a[0],&b[0],_MIN(sizeof(a),sizeof(b))); \
251
     memcpy(&a[0],&b[0],_MIN(sizeof(a),sizeof(b))); \
252
   }while(0)
252
   }while(0)
253
 
253
 
254
+#define CODE_11( A,B,C,D,E,F,G,H,I,J,K,...) A; B; C; D; E; F; G; H; I; J; K
255
+#define CODE_10( A,B,C,D,E,F,G,H,I,J,...) A; B; C; D; E; F; G; H; I; J
254
 #define CODE_9( A,B,C,D,E,F,G,H,I,...) A; B; C; D; E; F; G; H; I
256
 #define CODE_9( A,B,C,D,E,F,G,H,I,...) A; B; C; D; E; F; G; H; I
255
 #define CODE_8( A,B,C,D,E,F,G,H,...) A; B; C; D; E; F; G; H
257
 #define CODE_8( A,B,C,D,E,F,G,H,...) A; B; C; D; E; F; G; H
256
 #define CODE_7( A,B,C,D,E,F,G,...) A; B; C; D; E; F; G
258
 #define CODE_7( A,B,C,D,E,F,G,...) A; B; C; D; E; F; G
286
 #define GANG_N_1(N,K) _GANG_N(N,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K)
288
 #define GANG_N_1(N,K) _GANG_N(N,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K)
287
 
289
 
288
 // Macros for initializing arrays
290
 // Macros for initializing arrays
291
+#define LIST_20(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T
292
+#define LIST_19(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S
293
+#define LIST_18(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R
294
+#define LIST_17(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q
289
 #define LIST_16(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P
295
 #define LIST_16(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P
290
 #define LIST_15(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O
296
 #define LIST_15(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O
291
 #define LIST_14(A,B,C,D,E,F,G,H,I,J,K,L,M,N,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N
297
 #define LIST_14(A,B,C,D,E,F,G,H,I,J,K,L,M,N,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N
502
 #define INC_13 14
508
 #define INC_13 14
503
 #define INC_14 15
509
 #define INC_14 15
504
 #define INC_15 16
510
 #define INC_15 16
511
+#define INC_16 17
512
+#define INC_17 18
513
+#define INC_18 19
514
+#define INC_19 20
515
+#define INC_20 21
505
 #define INCREMENT_(n) INC_##n
516
 #define INCREMENT_(n) INC_##n
506
 #define INCREMENT(n) INCREMENT_(n)
517
 #define INCREMENT(n) INCREMENT_(n)
507
 
518
 

+ 3
- 3
Marlin/src/feature/backlash.cpp View File

60
  * spread over multiple segments, smoothing out artifacts even more.
60
  * spread over multiple segments, smoothing out artifacts even more.
61
  */
61
  */
62
 
62
 
63
-void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const uint8_t dm, block_t * const block) {
64
-  static uint8_t last_direction_bits;
65
-  uint8_t changed_dir = last_direction_bits ^ dm;
63
+void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const axis_bits_t dm, block_t * const block) {
64
+  static axis_bits_t last_direction_bits;
65
+  axis_bits_t changed_dir = last_direction_bits ^ dm;
66
   // Ignore direction change unless steps are taken in that direction
66
   // Ignore direction change unless steps are taken in that direction
67
   #if DISABLED(CORE_BACKLASH) || ENABLED(MARKFORGED_XY)
67
   #if DISABLED(CORE_BACKLASH) || ENABLED(MARKFORGED_XY)
68
     if (!da) CBI(changed_dir, X_AXIS);
68
     if (!da) CBI(changed_dir, X_AXIS);

+ 1
- 1
Marlin/src/feature/backlash.h View File

71
     return has_measurement(X_AXIS) || has_measurement(Y_AXIS) || has_measurement(Z_AXIS);
71
     return has_measurement(X_AXIS) || has_measurement(Y_AXIS) || has_measurement(Z_AXIS);
72
   }
72
   }
73
 
73
 
74
-  void add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const uint8_t dm, block_t * const block);
74
+  void add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const axis_bits_t dm, block_t * const block);
75
 };
75
 };
76
 
76
 
77
 extern Backlash backlash;
77
 extern Backlash backlash;

+ 3
- 3
Marlin/src/gcode/config/M217.cpp View File

141
                       SP_E_STR, LINEAR_UNIT(toolchange_settings.extra_prime),
141
                       SP_E_STR, LINEAR_UNIT(toolchange_settings.extra_prime),
142
                       SP_P_STR, LINEAR_UNIT(toolchange_settings.prime_speed));
142
                       SP_P_STR, LINEAR_UNIT(toolchange_settings.prime_speed));
143
     SERIAL_ECHOPGM(" R", LINEAR_UNIT(toolchange_settings.retract_speed),
143
     SERIAL_ECHOPGM(" R", LINEAR_UNIT(toolchange_settings.retract_speed),
144
-                    " U", LINEAR_UNIT(toolchange_settings.unretract_speed),
145
-                    " F", toolchange_settings.fan_speed,
146
-                    " G", toolchange_settings.fan_time);
144
+                   " U", LINEAR_UNIT(toolchange_settings.unretract_speed),
145
+                   " F", toolchange_settings.fan_speed,
146
+                   " G", toolchange_settings.fan_time);
147
 
147
 
148
     #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
148
     #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
149
       SERIAL_ECHOPGM(" A", migration.automode);
149
       SERIAL_ECHOPGM(" A", migration.automode);

+ 11
- 15
Marlin/src/gcode/feature/trinamic/M906.cpp View File

206
     SERIAL_ECHOPGM("  M906");
206
     SERIAL_ECHOPGM("  M906");
207
   };
207
   };
208
 
208
 
209
-  #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z)
209
+  #if  AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) \
210
+    || AXIS_IS_TMC(I) || AXIS_IS_TMC(J) || AXIS_IS_TMC(K)
210
     say_M906(forReplay);
211
     say_M906(forReplay);
211
     #if AXIS_IS_TMC(X)
212
     #if AXIS_IS_TMC(X)
212
       SERIAL_ECHOPGM_P(SP_X_STR, stepperX.getMilliamps());
213
       SERIAL_ECHOPGM_P(SP_X_STR, stepperX.getMilliamps());
217
     #if AXIS_IS_TMC(Z)
218
     #if AXIS_IS_TMC(Z)
218
       SERIAL_ECHOPGM_P(SP_Z_STR, stepperZ.getMilliamps());
219
       SERIAL_ECHOPGM_P(SP_Z_STR, stepperZ.getMilliamps());
219
     #endif
220
     #endif
221
+    #if AXIS_IS_TMC(I)
222
+      SERIAL_ECHOPGM_P(SP_I_STR, stepperI.getMilliamps());
223
+    #endif
224
+    #if AXIS_IS_TMC(J)
225
+      SERIAL_ECHOPGM_P(SP_J_STR, stepperJ.getMilliamps());
226
+    #endif
227
+    #if AXIS_IS_TMC(K)
228
+      SERIAL_ECHOPGM_P(SP_K_STR, stepperK.getMilliamps());
229
+    #endif
220
     SERIAL_EOL();
230
     SERIAL_EOL();
221
   #endif
231
   #endif
222
 
232
 
239
     say_M906(forReplay);
249
     say_M906(forReplay);
240
     SERIAL_ECHOLNPGM(" I2 Z", stepperZ3.getMilliamps());
250
     SERIAL_ECHOLNPGM(" I2 Z", stepperZ3.getMilliamps());
241
   #endif
251
   #endif
242
-
243
   #if AXIS_IS_TMC(Z4)
252
   #if AXIS_IS_TMC(Z4)
244
     say_M906(forReplay);
253
     say_M906(forReplay);
245
     SERIAL_ECHOLNPGM(" I3 Z", stepperZ4.getMilliamps());
254
     SERIAL_ECHOLNPGM(" I3 Z", stepperZ4.getMilliamps());
246
   #endif
255
   #endif
247
 
256
 
248
-  #if AXIS_IS_TMC(I)
249
-    say_M906(forReplay);
250
-    SERIAL_ECHOLNPGM_P(SP_I_STR, stepperI.getMilliamps());
251
-  #endif
252
-  #if AXIS_IS_TMC(J)
253
-    say_M906(forReplay);
254
-    SERIAL_ECHOLNPGM_P(SP_J_STR, stepperJ.getMilliamps());
255
-  #endif
256
-  #if AXIS_IS_TMC(K)
257
-    say_M906(forReplay);
258
-    SERIAL_ECHOLNPGM_P(SP_K_STR, stepperK.getMilliamps());
259
-  #endif
260
-
261
   #if AXIS_IS_TMC(E0)
257
   #if AXIS_IS_TMC(E0)
262
     say_M906(forReplay);
258
     say_M906(forReplay);
263
     SERIAL_ECHOLNPGM(" T0 E", stepperE0.getMilliamps());
259
     SERIAL_ECHOLNPGM(" T0 E", stepperE0.getMilliamps());

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

74
 
74
 
75
 // Relative motion mode for each logical axis
75
 // Relative motion mode for each logical axis
76
 static constexpr xyze_bool_t ar_init = AXIS_RELATIVE_MODES;
76
 static constexpr xyze_bool_t ar_init = AXIS_RELATIVE_MODES;
77
-uint8_t GcodeSuite::axis_relative = 0 LOGICAL_AXIS_GANG(
77
+axis_bits_t GcodeSuite::axis_relative = 0 LOGICAL_AXIS_GANG(
78
   | (ar_init.e << REL_E),
78
   | (ar_init.e << REL_E),
79
   | (ar_init.x << REL_X),
79
   | (ar_init.x << REL_X),
80
   | (ar_init.y << REL_Y),
80
   | (ar_init.y << REL_Y),

+ 1
- 1
Marlin/src/gcode/gcode.h View File

327
 class GcodeSuite {
327
 class GcodeSuite {
328
 public:
328
 public:
329
 
329
 
330
-  static uint8_t axis_relative;
330
+  static axis_bits_t axis_relative;
331
 
331
 
332
   static inline bool axis_is_relative(const AxisEnum a) {
332
   static inline bool axis_is_relative(const AxisEnum a) {
333
     #if HAS_EXTRUDERS
333
     #if HAS_EXTRUDERS

+ 1
- 2
Marlin/src/gcode/queue.cpp View File

260
       while (NUMERIC_SIGNED(*p))
260
       while (NUMERIC_SIGNED(*p))
261
         SERIAL_CHAR(*p++);
261
         SERIAL_CHAR(*p++);
262
     }
262
     }
263
-    SERIAL_ECHOPGM_P(SP_P_STR, planner.moves_free(),
264
-                      SP_B_STR, BUFSIZE - length);
263
+    SERIAL_ECHOPGM_P(SP_P_STR, planner.moves_free(), SP_B_STR, BUFSIZE - length);
265
   #endif
264
   #endif
266
   SERIAL_EOL();
265
   SERIAL_EOL();
267
 }
266
 }

+ 10
- 16
Marlin/src/inc/Conditionals_post.h View File

1927
   #ifndef Z4_INTERPOLATE
1927
   #ifndef Z4_INTERPOLATE
1928
     #define Z4_INTERPOLATE INTERPOLATE
1928
     #define Z4_INTERPOLATE INTERPOLATE
1929
   #endif
1929
   #endif
1930
-  #if LINEAR_AXES >= 4
1931
-    #ifndef I_INTERPOLATE
1932
-      #define I_INTERPOLATE INTERPOLATE
1933
-    #endif
1930
+  #if LINEAR_AXES >= 4 && !defined(I_INTERPOLATE)
1931
+    #define I_INTERPOLATE INTERPOLATE
1934
   #endif
1932
   #endif
1935
-  #if LINEAR_AXES >= 5
1936
-    #ifndef J_INTERPOLATE
1937
-      #define J_INTERPOLATE INTERPOLATE
1938
-    #endif
1933
+  #if LINEAR_AXES >= 5 && !defined(J_INTERPOLATE)
1934
+    #define J_INTERPOLATE INTERPOLATE
1939
   #endif
1935
   #endif
1940
-  #if LINEAR_AXES >= 6
1941
-    #ifndef K_INTERPOLATE
1942
-      #define K_INTERPOLATE INTERPOLATE
1943
-    #endif
1936
+  #if LINEAR_AXES >= 6 && !defined(K_INTERPOLATE)
1937
+    #define K_INTERPOLATE INTERPOLATE
1944
   #endif
1938
   #endif
1945
   #ifndef E0_INTERPOLATE
1939
   #ifndef E0_INTERPOLATE
1946
     #define E0_INTERPOLATE INTERPOLATE
1940
     #define E0_INTERPOLATE INTERPOLATE
1967
     #define E7_INTERPOLATE INTERPOLATE
1961
     #define E7_INTERPOLATE INTERPOLATE
1968
   #endif
1962
   #endif
1969
   #ifndef X_SLAVE_ADDRESS
1963
   #ifndef X_SLAVE_ADDRESS
1970
-    #define X_SLAVE_ADDRESS  0
1964
+    #define X_SLAVE_ADDRESS 0
1971
   #endif
1965
   #endif
1972
   #ifndef Y_SLAVE_ADDRESS
1966
   #ifndef Y_SLAVE_ADDRESS
1973
-    #define Y_SLAVE_ADDRESS  0
1967
+    #define Y_SLAVE_ADDRESS 0
1974
   #endif
1968
   #endif
1975
   #ifndef Z_SLAVE_ADDRESS
1969
   #ifndef Z_SLAVE_ADDRESS
1976
-    #define Z_SLAVE_ADDRESS  0
1970
+    #define Z_SLAVE_ADDRESS 0
1977
   #endif
1971
   #endif
1978
   #ifndef I_SLAVE_ADDRESS
1972
   #ifndef I_SLAVE_ADDRESS
1979
     #define I_SLAVE_ADDRESS 0
1973
     #define I_SLAVE_ADDRESS 0
2665
 #if HAS_EXTRUDERS && PIN_EXISTS(MOTOR_CURRENT_PWM_E)
2659
 #if HAS_EXTRUDERS && PIN_EXISTS(MOTOR_CURRENT_PWM_E)
2666
   #define HAS_MOTOR_CURRENT_PWM_E 1
2660
   #define HAS_MOTOR_CURRENT_PWM_E 1
2667
 #endif
2661
 #endif
2668
-#if HAS_MOTOR_CURRENT_PWM_E || ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_Z)
2662
+#if HAS_MOTOR_CURRENT_PWM_E || ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_Z, MOTOR_CURRENT_PWM_I, MOTOR_CURRENT_PWM_J, MOTOR_CURRENT_PWM_K)
2669
   #define HAS_MOTOR_CURRENT_PWM 1
2663
   #define HAS_MOTOR_CURRENT_PWM 1
2670
 #endif
2664
 #endif
2671
 
2665
 

+ 9
- 3
Marlin/src/inc/SanityCheck.h View File

1404
   #endif
1404
   #endif
1405
 #endif
1405
 #endif
1406
 #if LINEAR_AXES >= 5
1406
 #if LINEAR_AXES >= 5
1407
-  #if AXIS5_NAME == AXIS4_NAME || AXIS5_NAME == AXIS6_NAME
1408
-    #error "AXIS5_NAME must be different from AXIS4_NAME and AXIS6_NAME"
1407
+  #if AXIS5_NAME == AXIS4_NAME
1408
+    #error "AXIS5_NAME must be unique."
1409
   #elif AXIS5_NAME != 'A' && AXIS5_NAME != 'B' && AXIS5_NAME != 'C' && AXIS5_NAME != 'U' && AXIS5_NAME != 'V' && AXIS5_NAME != 'W'
1409
   #elif AXIS5_NAME != 'A' && AXIS5_NAME != 'B' && AXIS5_NAME != 'C' && AXIS5_NAME != 'U' && AXIS5_NAME != 'V' && AXIS5_NAME != 'W'
1410
     #error "AXIS5_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
1410
     #error "AXIS5_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
1411
   #elif !defined(J_MIN_POS) || !defined(J_MAX_POS)
1411
   #elif !defined(J_MIN_POS) || !defined(J_MAX_POS)
1418
 #endif
1418
 #endif
1419
 #if LINEAR_AXES >= 6
1419
 #if LINEAR_AXES >= 6
1420
   #if AXIS6_NAME == AXIS5_NAME || AXIS6_NAME == AXIS4_NAME
1420
   #if AXIS6_NAME == AXIS5_NAME || AXIS6_NAME == AXIS4_NAME
1421
-    #error "AXIS6_NAME must be different from AXIS5_NAME and AXIS4_NAME."
1421
+    #error "AXIS6_NAME must be unique."
1422
   #elif AXIS6_NAME != 'A' && AXIS6_NAME != 'B' && AXIS6_NAME != 'C' && AXIS6_NAME != 'U' && AXIS6_NAME != 'V' && AXIS6_NAME != 'W'
1422
   #elif AXIS6_NAME != 'A' && AXIS6_NAME != 'B' && AXIS6_NAME != 'C' && AXIS6_NAME != 'U' && AXIS6_NAME != 'V' && AXIS6_NAME != 'W'
1423
     #error "AXIS6_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
1423
     #error "AXIS6_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
1424
   #elif !defined(K_MIN_POS) || !defined(K_MAX_POS)
1424
   #elif !defined(K_MIN_POS) || !defined(K_MAX_POS)
3040
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMIN (or ENDSTOPPULLUPS) when homing to Z_MIN."
3040
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMIN (or ENDSTOPPULLUPS) when homing to Z_MIN."
3041
     #elif Z_SENSORLESS && Z_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_ZMAX)
3041
     #elif Z_SENSORLESS && Z_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_ZMAX)
3042
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMAX (or ENDSTOPPULLUPS) when homing to Z_MAX."
3042
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMAX (or ENDSTOPPULLUPS) when homing to Z_MAX."
3043
+    #elif LINEAR_AXES >= 4 && I_SENSORLESS && I_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_IMIN)
3044
+      #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_IMIN (or ENDSTOPPULLUPS) when homing to I_MIN."
3043
     #elif LINEAR_AXES >= 4 && I_SENSORLESS && I_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_IMAX)
3045
     #elif LINEAR_AXES >= 4 && I_SENSORLESS && I_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_IMAX)
3044
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_IMAX (or ENDSTOPPULLUPS) when homing to I_MAX."
3046
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_IMAX (or ENDSTOPPULLUPS) when homing to I_MAX."
3047
+    #elif LINEAR_AXES >= 5 && J_SENSORLESS && J_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_JMIN)
3048
+      #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_JMIN (or ENDSTOPPULLUPS) when homing to J_MIN."
3045
     #elif LINEAR_AXES >= 5 && J_SENSORLESS && J_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_JMAX)
3049
     #elif LINEAR_AXES >= 5 && J_SENSORLESS && J_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_JMAX)
3046
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_JMAX (or ENDSTOPPULLUPS) when homing to J_MAX."
3050
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_JMAX (or ENDSTOPPULLUPS) when homing to J_MAX."
3051
+    #elif LINEAR_AXES >= 6 && K_SENSORLESS && K_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_KMIN)
3052
+      #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_KMIN (or ENDSTOPPULLUPS) when homing to K_MIN."
3047
     #elif LINEAR_AXES >= 6 && K_SENSORLESS && K_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_KMAX)
3053
     #elif LINEAR_AXES >= 6 && K_SENSORLESS && K_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_KMAX)
3048
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_KMAX (or ENDSTOPPULLUPS) when homing to K_MAX."
3054
       #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_KMAX (or ENDSTOPPULLUPS) when homing to K_MAX."
3049
     #endif
3055
     #endif

+ 12
- 0
Marlin/src/lcd/extui/ui_api.cpp View File

423
         #if AXIS_IS_TMC(Z2)
423
         #if AXIS_IS_TMC(Z2)
424
           case Z2: return stepperZ2.getMilliamps();
424
           case Z2: return stepperZ2.getMilliamps();
425
         #endif
425
         #endif
426
+        #if AXIS_IS_TMC(Z3)
427
+          case Z3: return stepperZ3.getMilliamps();
428
+        #endif
429
+        #if AXIS_IS_TMC(Z4)
430
+          case Z4: return stepperZ4.getMilliamps();
431
+        #endif
426
         default: return NAN;
432
         default: return NAN;
427
       };
433
       };
428
     }
434
     }
486
         #if AXIS_IS_TMC(Z2)
492
         #if AXIS_IS_TMC(Z2)
487
           case Z2: stepperZ2.rms_current(constrain(mA, 400, 1500)); break;
493
           case Z2: stepperZ2.rms_current(constrain(mA, 400, 1500)); break;
488
         #endif
494
         #endif
495
+        #if AXIS_IS_TMC(Z3)
496
+          case Z3: stepperZ3.rms_current(constrain(mA, 400, 1500)); break;
497
+        #endif
498
+        #if AXIS_IS_TMC(Z4)
499
+          case Z4: stepperZ4.rms_current(constrain(mA, 400, 1500)); break;
500
+        #endif
489
         default: break;
501
         default: break;
490
       };
502
       };
491
     }
503
     }

+ 4
- 4
Marlin/src/module/planner.cpp View File

1310
  */
1310
  */
1311
 void Planner::check_axes_activity() {
1311
 void Planner::check_axes_activity() {
1312
 
1312
 
1313
-  #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z , DISABLE_I , DISABLE_J , DISABLE_K, DISABLE_E)
1313
+  #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_I, DISABLE_J, DISABLE_K, DISABLE_E)
1314
     xyze_bool_t axis_active = { false };
1314
     xyze_bool_t axis_active = { false };
1315
   #endif
1315
   #endif
1316
 
1316
 
1913
   #endif // PREVENT_COLD_EXTRUSION || PREVENT_LENGTHY_EXTRUDE
1913
   #endif // PREVENT_COLD_EXTRUSION || PREVENT_LENGTHY_EXTRUDE
1914
 
1914
 
1915
   // Compute direction bit-mask for this block
1915
   // Compute direction bit-mask for this block
1916
-  uint8_t dm = 0;
1916
+  axis_bits_t dm = 0;
1917
   #if CORE_IS_XY
1917
   #if CORE_IS_XY
1918
     if (da < 0) SBI(dm, X_HEAD);                // Save the toolhead's true direction in X
1918
     if (da < 0) SBI(dm, X_HEAD);                // Save the toolhead's true direction in X
1919
     if (db < 0) SBI(dm, Y_HEAD);                // ...and Y
1919
     if (db < 0) SBI(dm, Y_HEAD);                // ...and Y
2345
 
2345
 
2346
   #ifdef XY_FREQUENCY_LIMIT
2346
   #ifdef XY_FREQUENCY_LIMIT
2347
 
2347
 
2348
-    static uint8_t old_direction_bits; // = 0
2348
+    static axis_bits_t old_direction_bits; // = 0
2349
 
2349
 
2350
     if (xy_freq_limit_hz) {
2350
     if (xy_freq_limit_hz) {
2351
       // Check and limit the xy direction change frequency
2351
       // Check and limit the xy direction change frequency
2352
-      const uint8_t direction_change = block->direction_bits ^ old_direction_bits;
2352
+      const axis_bits_t direction_change = block->direction_bits ^ old_direction_bits;
2353
       old_direction_bits = block->direction_bits;
2353
       old_direction_bits = block->direction_bits;
2354
       segment_time_us = LROUND(float(segment_time_us) / speed_factor);
2354
       segment_time_us = LROUND(float(segment_time_us) / speed_factor);
2355
 
2355
 

+ 1
- 1
Marlin/src/module/planner.h View File

202
     uint32_t acceleration_rate;             // The acceleration rate used for acceleration calculation
202
     uint32_t acceleration_rate;             // The acceleration rate used for acceleration calculation
203
   #endif
203
   #endif
204
 
204
 
205
-  uint8_t direction_bits;                   // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h)
205
+  axis_bits_t direction_bits;               // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h)
206
 
206
 
207
   // Advance extrusion
207
   // Advance extrusion
208
   #if ENABLED(LIN_ADVANCE)
208
   #if ENABLED(LIN_ADVANCE)

+ 13
- 17
Marlin/src/module/stepper.cpp View File

149
 
149
 
150
 block_t* Stepper::current_block; // (= nullptr) A pointer to the block currently being traced
150
 block_t* Stepper::current_block; // (= nullptr) A pointer to the block currently being traced
151
 
151
 
152
-uint8_t Stepper::last_direction_bits, // = 0
153
-        Stepper::axis_did_move; // = 0
152
+axis_bits_t Stepper::last_direction_bits, // = 0
153
+            Stepper::axis_did_move; // = 0
154
 
154
 
155
 bool Stepper::abort_current_block;
155
 bool Stepper::abort_current_block;
156
 
156
 
503
   #if HAS_Z_DIR
503
   #if HAS_Z_DIR
504
     SET_STEP_DIR(Z); // C
504
     SET_STEP_DIR(Z); // C
505
   #endif
505
   #endif
506
-
507
   #if HAS_I_DIR
506
   #if HAS_I_DIR
508
-    SET_STEP_DIR(I); // I
507
+    SET_STEP_DIR(I);
509
   #endif
508
   #endif
510
-
511
   #if HAS_J_DIR
509
   #if HAS_J_DIR
512
-    SET_STEP_DIR(J); // J
510
+    SET_STEP_DIR(J);
513
   #endif
511
   #endif
514
-
515
   #if HAS_K_DIR
512
   #if HAS_K_DIR
516
-    SET_STEP_DIR(K); // K
513
+    SET_STEP_DIR(K);
517
   #endif
514
   #endif
518
 
515
 
519
   #if DISABLED(LIN_ADVANCE)
516
   #if DISABLED(LIN_ADVANCE)
1635
             case 0: {
1632
             case 0: {
1636
               const uint8_t low = page_step_state.page[page_step_state.segment_idx],
1633
               const uint8_t low = page_step_state.page[page_step_state.segment_idx],
1637
                            high = page_step_state.page[page_step_state.segment_idx + 1];
1634
                            high = page_step_state.page[page_step_state.segment_idx + 1];
1638
-              uint8_t dm = last_direction_bits;
1635
+              axis_bits_t dm = last_direction_bits;
1639
 
1636
 
1640
               PAGE_SEGMENT_UPDATE(X, low >> 4);
1637
               PAGE_SEGMENT_UPDATE(X, low >> 4);
1641
               PAGE_SEGMENT_UPDATE(Y, low & 0xF);
1638
               PAGE_SEGMENT_UPDATE(Y, low & 0xF);
2156
         #define Z_MOVE_TEST !!current_block->steps.c
2153
         #define Z_MOVE_TEST !!current_block->steps.c
2157
       #endif
2154
       #endif
2158
 
2155
 
2159
-      uint8_t axis_bits = 0;
2156
+      axis_bits_t axis_bits = 0;
2160
       LINEAR_AXIS_CODE(
2157
       LINEAR_AXIS_CODE(
2161
         if (X_MOVE_TEST)            SBI(axis_bits, A_AXIS),
2158
         if (X_MOVE_TEST)            SBI(axis_bits, A_AXIS),
2162
         if (Y_MOVE_TEST)            SBI(axis_bits, B_AXIS),
2159
         if (Y_MOVE_TEST)            SBI(axis_bits, B_AXIS),
3003
 
3000
 
3004
           const bool z_direction = direction ^ BABYSTEP_INVERT_Z;
3001
           const bool z_direction = direction ^ BABYSTEP_INVERT_Z;
3005
 
3002
 
3006
-          ENABLE_AXIS_X();
3007
-          ENABLE_AXIS_Y();
3008
-          ENABLE_AXIS_Z();
3009
-          ENABLE_AXIS_I();
3010
-          ENABLE_AXIS_J();
3011
-          ENABLE_AXIS_K();
3003
+          ENABLE_AXIS_X(); ENABLE_AXIS_Y(); ENABLE_AXIS_Z();
3004
+          ENABLE_AXIS_I(); ENABLE_AXIS_J(); ENABLE_AXIS_K();
3012
 
3005
 
3013
           DIR_WAIT_BEFORE();
3006
           DIR_WAIT_BEFORE();
3014
 
3007
 
3015
-          const xyz_byte_t old_dir = LINEAR_AXIS_ARRAY(X_DIR_READ(), Y_DIR_READ(), Z_DIR_READ(), I_DIR_READ(), J_DIR_READ(), K_DIR_READ());
3008
+          const xyz_byte_t old_dir = LINEAR_AXIS_ARRAY(
3009
+            X_DIR_READ(), Y_DIR_READ(), Z_DIR_READ(),
3010
+            I_DIR_READ(), J_DIR_READ(), K_DIR_READ()
3011
+          );
3016
 
3012
 
3017
           X_DIR_WRITE(INVERT_X_DIR ^ z_direction);
3013
           X_DIR_WRITE(INVERT_X_DIR ^ z_direction);
3018
           #ifdef Y_DIR_WRITE
3014
           #ifdef Y_DIR_WRITE

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

276
 
276
 
277
     static block_t* current_block;          // A pointer to the block currently being traced
277
     static block_t* current_block;          // A pointer to the block currently being traced
278
 
278
 
279
-    static uint8_t last_direction_bits,     // The next stepping-bits to be output
280
-                   axis_did_move;           // Last Movement in the given direction is not null, as computed when the last movement was fetched from planner
279
+    static axis_bits_t last_direction_bits, // The next stepping-bits to be output
280
+                       axis_did_move;       // Last Movement in the given direction is not null, as computed when the last movement was fetched from planner
281
 
281
 
282
     static bool abort_current_block;        // Signals to the stepper that current block should be aborted
282
     static bool abort_current_block;        // Signals to the stepper that current block should be aborted
283
 
283
 
523
     static void set_directions();
523
     static void set_directions();
524
 
524
 
525
     // Set direction bits and update all stepper DIR states
525
     // Set direction bits and update all stepper DIR states
526
-    static void set_directions(const uint8_t bits) {
526
+    static void set_directions(const axis_bits_t bits) {
527
       last_direction_bits = bits;
527
       last_direction_bits = bits;
528
       set_directions();
528
       set_directions();
529
     }
529
     }

+ 3
- 3
Marlin/src/module/stepper/indirection.h View File

896
 #endif
896
 #endif
897
 
897
 
898
 #if LINEAR_AXES >= 4
898
 #if LINEAR_AXES >= 4
899
-  #define  ENABLE_AXIS_I() if (SHOULD_ENABLE(i))  {  ENABLE_STEPPER_I();  AFTER_CHANGE(i, true); }
899
+  #define  ENABLE_AXIS_I() if (SHOULD_ENABLE(i))  {  ENABLE_STEPPER_I(); AFTER_CHANGE(i, true); }
900
   #define DISABLE_AXIS_I() if (SHOULD_DISABLE(i)) { DISABLE_STEPPER_I(); AFTER_CHANGE(i, false); set_axis_untrusted(I_AXIS); }
900
   #define DISABLE_AXIS_I() if (SHOULD_DISABLE(i)) { DISABLE_STEPPER_I(); AFTER_CHANGE(i, false); set_axis_untrusted(I_AXIS); }
901
 #else
901
 #else
902
   #define  ENABLE_AXIS_I() NOOP
902
   #define  ENABLE_AXIS_I() NOOP
903
   #define DISABLE_AXIS_I() NOOP
903
   #define DISABLE_AXIS_I() NOOP
904
 #endif
904
 #endif
905
 #if LINEAR_AXES >= 5
905
 #if LINEAR_AXES >= 5
906
-  #define  ENABLE_AXIS_J() if (SHOULD_ENABLE(j))  {  ENABLE_STEPPER_J();  AFTER_CHANGE(j, true); }
906
+  #define  ENABLE_AXIS_J() if (SHOULD_ENABLE(j))  {  ENABLE_STEPPER_J(); AFTER_CHANGE(j, true); }
907
   #define DISABLE_AXIS_J() if (SHOULD_DISABLE(j)) { DISABLE_STEPPER_J(); AFTER_CHANGE(j, false); set_axis_untrusted(J_AXIS); }
907
   #define DISABLE_AXIS_J() if (SHOULD_DISABLE(j)) { DISABLE_STEPPER_J(); AFTER_CHANGE(j, false); set_axis_untrusted(J_AXIS); }
908
 #else
908
 #else
909
   #define  ENABLE_AXIS_J() NOOP
909
   #define  ENABLE_AXIS_J() NOOP
910
   #define DISABLE_AXIS_J() NOOP
910
   #define DISABLE_AXIS_J() NOOP
911
 #endif
911
 #endif
912
 #if LINEAR_AXES >= 6
912
 #if LINEAR_AXES >= 6
913
-  #define  ENABLE_AXIS_K() if (SHOULD_ENABLE(k))  {  ENABLE_STEPPER_K();  AFTER_CHANGE(k, true); }
913
+  #define  ENABLE_AXIS_K() if (SHOULD_ENABLE(k))  {  ENABLE_STEPPER_K(); AFTER_CHANGE(k, true); }
914
   #define DISABLE_AXIS_K() if (SHOULD_DISABLE(k)) { DISABLE_STEPPER_K(); AFTER_CHANGE(k, false); set_axis_untrusted(K_AXIS); }
914
   #define DISABLE_AXIS_K() if (SHOULD_DISABLE(k)) { DISABLE_STEPPER_K(); AFTER_CHANGE(k, false); set_axis_untrusted(K_AXIS); }
915
 #else
915
 #else
916
   #define  ENABLE_AXIS_K() NOOP
916
   #define  ENABLE_AXIS_K() NOOP

+ 11
- 6
Marlin/src/module/stepper/trinamic.cpp View File

164
 #ifndef TMC_Z4_BAUD_RATE
164
 #ifndef TMC_Z4_BAUD_RATE
165
   #define TMC_Z4_BAUD_RATE TMC_BAUD_RATE
165
   #define TMC_Z4_BAUD_RATE TMC_BAUD_RATE
166
 #endif
166
 #endif
167
+#ifndef TMC_I_BAUD_RATE
168
+  #define TMC_I_BAUD_RATE TMC_BAUD_RATE
169
+#endif
170
+#ifndef TMC_J_BAUD_RATE
171
+  #define TMC_J_BAUD_RATE TMC_BAUD_RATE
172
+#endif
173
+#ifndef TMC_K_BAUD_RATE
174
+  #define TMC_K_BAUD_RATE TMC_BAUD_RATE
175
+#endif
167
 #ifndef TMC_E0_BAUD_RATE
176
 #ifndef TMC_E0_BAUD_RATE
168
   #define TMC_E0_BAUD_RATE TMC_BAUD_RATE
177
   #define TMC_E0_BAUD_RATE TMC_BAUD_RATE
169
 #endif
178
 #endif
834
 void reset_trinamic_drivers() {
843
 void reset_trinamic_drivers() {
835
   static constexpr bool stealthchop_by_axis[] = LOGICAL_AXIS_ARRAY(
844
   static constexpr bool stealthchop_by_axis[] = LOGICAL_AXIS_ARRAY(
836
     ENABLED(STEALTHCHOP_E),
845
     ENABLED(STEALTHCHOP_E),
837
-    ENABLED(STEALTHCHOP_XY),
838
-    ENABLED(STEALTHCHOP_XY),
839
-    ENABLED(STEALTHCHOP_Z),
840
-    ENABLED(STEALTHCHOP_I),
841
-    ENABLED(STEALTHCHOP_J),
842
-    ENABLED(STEALTHCHOP_K)
846
+    ENABLED(STEALTHCHOP_XY), ENABLED(STEALTHCHOP_XY), ENABLED(STEALTHCHOP_Z),
847
+    ENABLED(STEALTHCHOP_I), ENABLED(STEALTHCHOP_J), ENABLED(STEALTHCHOP_K)
843
   );
848
   );
844
 
849
 
845
   #if AXIS_IS_TMC(X)
850
   #if AXIS_IS_TMC(X)

+ 30
- 6
Marlin/src/pins/pins_postprocess.h View File

464
   #ifdef I_STOP_PIN
464
   #ifdef I_STOP_PIN
465
     #if I_HOME_TO_MIN
465
     #if I_HOME_TO_MIN
466
       #define I_MIN_PIN I_STOP_PIN
466
       #define I_MIN_PIN I_STOP_PIN
467
-      #define I_MAX_PIN -1
467
+      #ifndef I_MAX_PIN
468
+        #define I_MAX_PIN -1
469
+      #endif
468
     #else
470
     #else
469
-      #define I_MIN_PIN -1
470
       #define I_MAX_PIN I_STOP_PIN
471
       #define I_MAX_PIN I_STOP_PIN
472
+      #ifndef I_MIN_PIN
473
+        #define I_MIN_PIN -1
474
+      #endif
471
     #endif
475
     #endif
476
+  #elif I_HOME_TO_MIN
477
+    #define I_STOP_PIN I_MIN_PIN
478
+  #else
479
+    #define I_STOP_PIN I_MAX_PIN
472
   #endif
480
   #endif
473
 #else
481
 #else
474
   #undef I_MIN_PIN
482
   #undef I_MIN_PIN
479
   #ifdef J_STOP_PIN
487
   #ifdef J_STOP_PIN
480
     #if J_HOME_TO_MIN
488
     #if J_HOME_TO_MIN
481
       #define J_MIN_PIN J_STOP_PIN
489
       #define J_MIN_PIN J_STOP_PIN
482
-      #define J_MAX_PIN -1
490
+      #ifndef J_MAX_PIN
491
+        #define J_MAX_PIN -1
492
+      #endif
483
     #else
493
     #else
484
-      #define J_MIN_PIN -1
485
       #define J_MAX_PIN J_STOP_PIN
494
       #define J_MAX_PIN J_STOP_PIN
495
+      #ifndef J_MIN_PIN
496
+        #define J_MIN_PIN -1
497
+      #endif
486
     #endif
498
     #endif
499
+  #elif J_HOME_TO_MIN
500
+    #define J_STOP_PIN J_MIN_PIN
501
+  #else
502
+    #define J_STOP_PIN J_MAX_PIN
487
   #endif
503
   #endif
488
 #else
504
 #else
489
   #undef J_MIN_PIN
505
   #undef J_MIN_PIN
494
   #ifdef K_STOP_PIN
510
   #ifdef K_STOP_PIN
495
     #if K_HOME_TO_MIN
511
     #if K_HOME_TO_MIN
496
       #define K_MIN_PIN K_STOP_PIN
512
       #define K_MIN_PIN K_STOP_PIN
497
-      #define K_MAX_PIN -1
513
+      #ifndef K_MAX_PIN
514
+        #define K_MAX_PIN -1
515
+      #endif
498
     #else
516
     #else
499
-      #define K_MIN_PIN -1
500
       #define K_MAX_PIN K_STOP_PIN
517
       #define K_MAX_PIN K_STOP_PIN
518
+      #ifndef K_MIN_PIN
519
+        #define K_MIN_PIN -1
520
+      #endif
501
     #endif
521
     #endif
522
+  #elif K_HOME_TO_MIN
523
+    #define K_STOP_PIN K_MIN_PIN
524
+  #else
525
+    #define K_STOP_PIN K_MAX_PIN
502
   #endif
526
   #endif
503
 #else
527
 #else
504
   #undef K_MIN_PIN
528
   #undef K_MIN_PIN

Loading…
Cancel
Save