Browse Source

🧑‍💻 Misc. updates for extra axes (#23521)

Scott Lahteine 2 years ago
parent
commit
40481947fc
No account linked to committer's email address

+ 3
- 3
Marlin/Configuration_adv.h View File

@@ -3224,7 +3224,7 @@
3224 3224
     #define Z4_SLEW_RATE                 1
3225 3225
   #endif
3226 3226
 
3227
-  #if AXIS_DRIVER_TYPE_I(L6470)
3227
+  #if AXIS_IS_L64XX(I)
3228 3228
     #define I_MICROSTEPS      128
3229 3229
     #define I_OVERCURRENT    2000
3230 3230
     #define I_STALLCURRENT   1500
@@ -3233,7 +3233,7 @@
3233 3233
     #define I_SLEW_RATE         1
3234 3234
   #endif
3235 3235
 
3236
-  #if AXIS_DRIVER_TYPE_J(L6470)
3236
+  #if AXIS_IS_L64XX(J)
3237 3237
     #define J_MICROSTEPS      128
3238 3238
     #define J_OVERCURRENT    2000
3239 3239
     #define J_STALLCURRENT   1500
@@ -3242,7 +3242,7 @@
3242 3242
     #define J_SLEW_RATE         1
3243 3243
   #endif
3244 3244
 
3245
-  #if AXIS_DRIVER_TYPE_K(L6470)
3245
+  #if AXIS_IS_L64XX(K)
3246 3246
     #define K_MICROSTEPS      128
3247 3247
     #define K_OVERCURRENT    2000
3248 3248
     #define K_STALLCURRENT   1500

+ 1
- 0
Marlin/src/HAL/AVR/endstop_interrupts.h View File

@@ -301,5 +301,6 @@ void setup_endstop_interrupts() {
301 301
       pciSetup(Z_MIN_PROBE_PIN);
302 302
     #endif
303 303
   #endif
304
+
304 305
   // If we arrive here without raising an assertion, each pin has either an EXT-interrupt or a PCI.
305 306
 }

+ 5
- 23
Marlin/src/core/language.h View File

@@ -384,20 +384,14 @@
384 384
     #define STR_I_MIN "w_min"
385 385
     #define STR_I_MAX "w_max"
386 386
   #else
387
-    #define STR_I "A"
388
-    #define STR_I_MIN "a_min"
389
-    #define STR_I_MAX "a_max"
387
+    #error "AXIS4_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
390 388
   #endif
391 389
 #else
392 390
   #define STR_I   ""
393 391
 #endif
394 392
 
395 393
 #if HAS_J_AXIS
396
-  #if AXIS5_NAME == 'A'
397
-    #define STR_J "A"
398
-    #define STR_J_MIN "a_min"
399
-    #define STR_J_MAX "a_max"
400
-  #elif AXIS5_NAME == 'B'
394
+  #if AXIS5_NAME == 'B'
401 395
     #define STR_J "B"
402 396
     #define STR_J_MIN "b_min"
403 397
     #define STR_J_MAX "b_max"
@@ -418,24 +412,14 @@
418 412
     #define STR_J_MIN "w_min"
419 413
     #define STR_J_MAX "w_max"
420 414
   #else
421
-    #define STR_J "B"
422
-    #define STR_J_MIN "b_min"
423
-    #define STR_J_MAX "b_max"
415
+    #error "AXIS5_NAME can only be one of 'B', 'C', 'U', 'V', or 'W'."
424 416
   #endif
425 417
 #else
426 418
   #define STR_J   ""
427 419
 #endif
428 420
 
429 421
 #if HAS_K_AXIS
430
-  #if AXIS6_NAME == 'A'
431
-    #define STR_K "A"
432
-    #define STR_K_MIN "a_min"
433
-    #define STR_K_MAX "a_max"
434
-  #elif AXIS6_NAME == 'B'
435
-    #define STR_K "B"
436
-    #define STR_K_MIN "b_min"
437
-    #define STR_K_MAX "b_max"
438
-  #elif AXIS6_NAME == 'C'
422
+  #if AXIS6_NAME == 'C'
439 423
     #define STR_K "C"
440 424
     #define STR_K_MIN "c_min"
441 425
     #define STR_K_MAX "c_max"
@@ -452,9 +436,7 @@
452 436
     #define STR_K_MIN "w_min"
453 437
     #define STR_K_MAX "w_max"
454 438
   #else
455
-    #define STR_K "C"
456
-    #define STR_K_MIN "c_min"
457
-    #define STR_K_MAX "c_max"
439
+    #error "AXIS6_NAME can only be one of 'C', 'U', 'V', or 'W'."
458 440
   #endif
459 441
 #else
460 442
   #define STR_K   ""

+ 5
- 5
Marlin/src/feature/direct_stepping.cpp View File

@@ -52,13 +52,13 @@ namespace DirectStepping {
52 52
   volatile bool SerialPageManager<Cfg>::fatal_error;
53 53
 
54 54
   template<typename Cfg>
55
-  volatile PageState SerialPageManager<Cfg>::page_states[Cfg::NUM_PAGES];
55
+  volatile PageState SerialPageManager<Cfg>::page_states[Cfg::PAGE_COUNT];
56 56
 
57 57
   template<typename Cfg>
58 58
   volatile bool SerialPageManager<Cfg>::page_states_dirty;
59 59
 
60 60
   template<typename Cfg>
61
-  uint8_t SerialPageManager<Cfg>::pages[Cfg::NUM_PAGES][Cfg::PAGE_SIZE];
61
+  uint8_t SerialPageManager<Cfg>::pages[Cfg::PAGE_COUNT][Cfg::PAGE_SIZE];
62 62
 
63 63
   template<typename Cfg>
64 64
   uint8_t SerialPageManager<Cfg>::checksum;
@@ -74,7 +74,7 @@ namespace DirectStepping {
74 74
 
75 75
   template <typename Cfg>
76 76
   void SerialPageManager<Cfg>::init() {
77
-    for (int i = 0 ; i < Cfg::NUM_PAGES ; i++)
77
+    for (int i = 0 ; i < Cfg::PAGE_COUNT ; i++)
78 78
       page_states[i] = PageState::FREE;
79 79
 
80 80
     fatal_error = false;
@@ -183,10 +183,10 @@ namespace DirectStepping {
183 183
 
184 184
     SERIAL_CHAR(Cfg::CONTROL_CHAR);
185 185
     constexpr int state_bits = 2;
186
-    constexpr int n_bytes = Cfg::NUM_PAGES >> state_bits;
186
+    constexpr int n_bytes = Cfg::PAGE_COUNT >> state_bits;
187 187
     volatile uint8_t bits_b[n_bytes] = { 0 };
188 188
 
189
-    for (page_idx_t i = 0 ; i < Cfg::NUM_PAGES ; i++) {
189
+    for (page_idx_t i = 0 ; i < Cfg::PAGE_COUNT ; i++) {
190 190
       bits_b[i >> state_bits] |= page_states[i] << ((i * state_bits) & 0x7);
191 191
     }
192 192
 

+ 6
- 6
Marlin/src/feature/direct_stepping.h View File

@@ -68,10 +68,10 @@ namespace DirectStepping {
68 68
     static State state;
69 69
     static volatile bool fatal_error;
70 70
 
71
-    static volatile PageState page_states[Cfg::NUM_PAGES];
71
+    static volatile PageState page_states[Cfg::PAGE_COUNT];
72 72
     static volatile bool page_states_dirty;
73 73
 
74
-    static uint8_t pages[Cfg::NUM_PAGES][Cfg::PAGE_SIZE];
74
+    static uint8_t pages[Cfg::PAGE_COUNT][Cfg::PAGE_SIZE];
75 75
     static uint8_t checksum;
76 76
     static write_byte_idx_t write_byte_idx;
77 77
     static page_idx_t write_page_idx;
@@ -87,8 +87,8 @@ namespace DirectStepping {
87 87
   struct config_t {
88 88
     static constexpr char CONTROL_CHAR  = '!';
89 89
 
90
-    static constexpr int NUM_PAGES      = num_pages;
91
-    static constexpr int NUM_AXES       = num_axes;
90
+    static constexpr int PAGE_COUNT     = num_pages;
91
+    static constexpr int AXIS_COUNT     = num_axes;
92 92
     static constexpr int BITS_SEGMENT   = bits_segment;
93 93
     static constexpr int DIRECTIONAL    = dir ? 1 : 0;
94 94
     static constexpr int SEGMENTS       = segments;
@@ -96,10 +96,10 @@ namespace DirectStepping {
96 96
     static constexpr int NUM_SEGMENTS   = _BV(BITS_SEGMENT);
97 97
     static constexpr int SEGMENT_STEPS  = _BV(BITS_SEGMENT - DIRECTIONAL) - 1;
98 98
     static constexpr int TOTAL_STEPS    = SEGMENT_STEPS * SEGMENTS;
99
-    static constexpr int PAGE_SIZE      = (NUM_AXES * BITS_SEGMENT * SEGMENTS) / 8;
99
+    static constexpr int PAGE_SIZE      = (AXIS_COUNT * BITS_SEGMENT * SEGMENTS) / 8;
100 100
 
101 101
     typedef typename TypeSelector<(PAGE_SIZE>256), uint16_t, uint8_t>::type write_byte_idx_t;
102
-    typedef typename TypeSelector<(NUM_PAGES>256), uint16_t, uint8_t>::type page_idx_t;
102
+    typedef typename TypeSelector<(PAGE_COUNT>256), uint16_t, uint8_t>::type page_idx_t;
103 103
   };
104 104
 
105 105
   template <uint8_t num_pages>

+ 0
- 2
Marlin/src/feature/tmc_util.cpp View File

@@ -421,12 +421,10 @@
421 421
         if (monitor_tmc_driver(stepperI, need_update_error_counters, need_debug_reporting))
422 422
           step_current_down(stepperI);
423 423
       #endif
424
-
425 424
       #if AXIS_IS_TMC(J)
426 425
         if (monitor_tmc_driver(stepperJ, need_update_error_counters, need_debug_reporting))
427 426
           step_current_down(stepperJ);
428 427
       #endif
429
-
430 428
       #if AXIS_IS_TMC(K)
431 429
         if (monitor_tmc_driver(stepperK, need_update_error_counters, need_debug_reporting))
432 430
           step_current_down(stepperK);

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

@@ -262,7 +262,7 @@ void GcodeSuite::G28() {
262 262
   reset_stepper_timeout();
263 263
 
264 264
   #define HAS_CURRENT_HOME(N) (defined(N##_CURRENT_HOME) && N##_CURRENT_HOME != N##_CURRENT)
265
-  #if HAS_CURRENT_HOME(X) || HAS_CURRENT_HOME(X2) || HAS_CURRENT_HOME(Y) || HAS_CURRENT_HOME(Y2) || HAS_CURRENT_HOME(I) || HAS_CURRENT_HOME(J) || HAS_CURRENT_HOME(K) || (ENABLED(DELTA) && HAS_CURRENT_HOME(Z))
265
+  #if HAS_CURRENT_HOME(X) || HAS_CURRENT_HOME(X2) || HAS_CURRENT_HOME(Y) || HAS_CURRENT_HOME(Y2) || (ENABLED(DELTA) && HAS_CURRENT_HOME(Z)) || HAS_CURRENT_HOME(I) || HAS_CURRENT_HOME(J) || HAS_CURRENT_HOME(K)
266 266
     #define HAS_HOMING_CURRENT 1
267 267
   #endif
268 268
 
@@ -273,22 +273,22 @@ void GcodeSuite::G28() {
273 273
     #if HAS_CURRENT_HOME(X)
274 274
       const int16_t tmc_save_current_X = stepperX.getMilliamps();
275 275
       stepperX.rms_current(X_CURRENT_HOME);
276
-      if (DEBUGGING(LEVELING)) debug_current(F("X"), tmc_save_current_X, X_CURRENT_HOME);
276
+      if (DEBUGGING(LEVELING)) debug_current(F(STR_X), tmc_save_current_X, X_CURRENT_HOME);
277 277
     #endif
278 278
     #if HAS_CURRENT_HOME(X2)
279 279
       const int16_t tmc_save_current_X2 = stepperX2.getMilliamps();
280 280
       stepperX2.rms_current(X2_CURRENT_HOME);
281
-      if (DEBUGGING(LEVELING)) debug_current(F("X2"), tmc_save_current_X2, X2_CURRENT_HOME);
281
+      if (DEBUGGING(LEVELING)) debug_current(F(STR_X2), tmc_save_current_X2, X2_CURRENT_HOME);
282 282
     #endif
283 283
     #if HAS_CURRENT_HOME(Y)
284 284
       const int16_t tmc_save_current_Y = stepperY.getMilliamps();
285 285
       stepperY.rms_current(Y_CURRENT_HOME);
286
-      if (DEBUGGING(LEVELING)) debug_current(F("Y"), tmc_save_current_Y, Y_CURRENT_HOME);
286
+      if (DEBUGGING(LEVELING)) debug_current(F(STR_Y), tmc_save_current_Y, Y_CURRENT_HOME);
287 287
     #endif
288 288
     #if HAS_CURRENT_HOME(Y2)
289 289
       const int16_t tmc_save_current_Y2 = stepperY2.getMilliamps();
290 290
       stepperY2.rms_current(Y2_CURRENT_HOME);
291
-      if (DEBUGGING(LEVELING)) debug_current(F("Y2"), tmc_save_current_Y2, Y2_CURRENT_HOME);
291
+      if (DEBUGGING(LEVELING)) debug_current(F(STR_Y2), tmc_save_current_Y2, Y2_CURRENT_HOME);
292 292
     #endif
293 293
     #if HAS_CURRENT_HOME(I)
294 294
       const int16_t tmc_save_current_I = stepperI.getMilliamps();
@@ -308,7 +308,22 @@ void GcodeSuite::G28() {
308 308
     #if HAS_CURRENT_HOME(Z) && ENABLED(DELTA)
309 309
       const int16_t tmc_save_current_Z = stepperZ.getMilliamps();
310 310
       stepperZ.rms_current(Z_CURRENT_HOME);
311
-      if (DEBUGGING(LEVELING)) debug_current(F("Z"), tmc_save_current_Z, Z_CURRENT_HOME);
311
+      if (DEBUGGING(LEVELING)) debug_current(F(STR_Z), tmc_save_current_Z, Z_CURRENT_HOME);
312
+    #endif
313
+    #if HAS_CURRENT_HOME(I)
314
+      const int16_t tmc_save_current_I = stepperI.getMilliamps();
315
+      stepperI.rms_current(I_CURRENT_HOME);
316
+      if (DEBUGGING(LEVELING)) debug_current(F(STR_I), tmc_save_current_I, I_CURRENT_HOME);
317
+    #endif
318
+    #if HAS_CURRENT_HOME(J)
319
+      const int16_t tmc_save_current_J = stepperJ.getMilliamps();
320
+      stepperJ.rms_current(J_CURRENT_HOME);
321
+      if (DEBUGGING(LEVELING)) debug_current(F(STR_J), tmc_save_current_J, J_CURRENT_HOME);
322
+    #endif
323
+    #if HAS_CURRENT_HOME(K)
324
+      const int16_t tmc_save_current_K = stepperK.getMilliamps();
325
+      stepperK.rms_current(K_CURRENT_HOME);
326
+      if (DEBUGGING(LEVELING)) debug_current(F(STR_K), tmc_save_current_K, K_CURRENT_HOME);
312 327
     #endif
313 328
   #endif
314 329
 
@@ -361,7 +376,7 @@ void GcodeSuite::G28() {
361 376
                  homeX = needX || parser.seen_test('X'),
362 377
                  homeY = needY || parser.seen_test('Y'),
363 378
                  homeZZ = homeZ,
364
-                 homeI = needI || parser.seen_test(AXIS4_NAME), homeJ = needJ || parser.seen_test(AXIS5_NAME), homeK = needK || parser.seen_test(AXIS6_NAME),
379
+                 homeI = needI || parser.seen_test(AXIS4_NAME), homeJ = needJ || parser.seen_test(AXIS5_NAME), homeK = needK || parser.seen_test(AXIS6_NAME)
365 380
                ),
366 381
                home_all = LINEAR_AXIS_GANG(   // Home-all if all or none are flagged
367 382
                     homeX == homeX, && homeY == homeX, && homeZ == homeX,

+ 8
- 10
Marlin/src/gcode/calibrate/G425.cpp View File

@@ -241,14 +241,15 @@ inline void probe_side(measurements_t &m, const float uncertainty, const side_t
241 241
 
242 242
   park_above_object(m, uncertainty);
243 243
 
244
+  #define _ACASE(N,A,B) case A: dir = -1; case B: axis = N##_AXIS; break
245
+  #define _PCASE(N) _ACASE(N, N##MINIMUM, N##MAXIMUM)
246
+
244 247
   switch (side) {
245 248
     #if AXIS_CAN_CALIBRATE(X)
246
-      case RIGHT: dir = -1;
247
-      case LEFT:  axis = X_AXIS; break;
249
+      _ACASE(X, RIGHT, LEFT);
248 250
     #endif
249 251
     #if HAS_Y_AXIS && AXIS_CAN_CALIBRATE(Y)
250
-      case BACK:  dir = -1;
251
-      case FRONT: axis = Y_AXIS; break;
252
+      _ACASE(Y, BACK, FRONT);
252 253
     #endif
253 254
     #if HAS_Z_AXIS && AXIS_CAN_CALIBRATE(Z)
254 255
       case TOP: {
@@ -259,16 +260,13 @@ inline void probe_side(measurements_t &m, const float uncertainty, const side_t
259 260
       }
260 261
     #endif
261 262
     #if HAS_I_AXIS && AXIS_CAN_CALIBRATE(I)
262
-      case IMINIMUM: dir = -1;
263
-      case IMAXIMUM: axis = I_AXIS; break;
263
+      _PCASE(I);
264 264
     #endif
265 265
     #if HAS_J_AXIS && AXIS_CAN_CALIBRATE(J)
266
-      case JMINIMUM: dir = -1;
267
-      case JMAXIMUM: axis = J_AXIS; break;
266
+      _PCASE(J);
268 267
     #endif
269 268
     #if HAS_K_AXIS && AXIS_CAN_CALIBRATE(K)
270
-      case KMINIMUM: dir = -1;
271
-      case KMAXIMUM: axis = K_AXIS; break;
269
+      _PCASE(K);
272 270
     #endif
273 271
     default: return;
274 272
   }

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

@@ -55,7 +55,7 @@ void GcodeSuite::M425() {
55 55
         case Z_AXIS: return AXIS_CAN_CALIBRATE(Z),
56 56
         case I_AXIS: return AXIS_CAN_CALIBRATE(I),
57 57
         case J_AXIS: return AXIS_CAN_CALIBRATE(J),
58
-        case K_AXIS: return AXIS_CAN_CALIBRATE(K),
58
+        case K_AXIS: return AXIS_CAN_CALIBRATE(K)
59 59
       );
60 60
     }
61 61
   };

+ 7
- 2
Marlin/src/gcode/config/M200-M205.cpp View File

@@ -288,8 +288,13 @@ void GcodeSuite::M205_report(const bool forReplay/*=true*/) {
288 288
   report_heading_etc(forReplay, F(
289 289
     "Advanced (B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>"
290 290
     TERN_(HAS_JUNCTION_DEVIATION, " J<junc_dev>")
291
-    TERN_(HAS_CLASSIC_JERK, " X<max_x_jerk> Y<max_y_jerk> Z<max_z_jerk>")
292
-    TERN_(HAS_CLASSIC_E_JERK, " E<max_e_jerk>")
291
+    #if HAS_CLASSIC_JERK
292
+      LINEAR_AXIS_GANG(
293
+        " X<max_jerk>", " Y<max_jerk>", " Z<max_jerk>",
294
+        " " STR_I "<max_jerk>", " " STR_J "<max_jerk>", " " STR_K "<max_jerk>"
295
+      )
296
+    #endif
297
+    TERN_(HAS_CLASSIC_E_JERK, " E<max_jerk>")
293 298
     ")"
294 299
   ));
295 300
   SERIAL_ECHOLNPGM_P(

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

@@ -50,6 +50,9 @@
50 50
  *  W[linear]   0/1 Enable park & Z Raise
51 51
  *  X[linear]   Park X (Requires TOOLCHANGE_PARK)
52 52
  *  Y[linear]   Park Y (Requires TOOLCHANGE_PARK)
53
+ *  I[linear]   Park I (Requires TOOLCHANGE_PARK and LINEAR_AXES >= 4)
54
+ *  J[linear]   Park J (Requires TOOLCHANGE_PARK and LINEAR_AXES >= 5)
55
+ *  K[linear]   Park K (Requires TOOLCHANGE_PARK and LINEAR_AXES >= 6)
53 56
  *  Z[linear]   Z Raise
54 57
  *  F[linear]   Fan Speed 0-255
55 58
  *  G[linear/s] Fan time
@@ -88,10 +91,23 @@ void GcodeSuite::M217() {
88 91
   #if ENABLED(TOOLCHANGE_PARK)
89 92
     if (parser.seenval('W')) { toolchange_settings.enable_park = parser.value_linear_units(); }
90 93
     if (parser.seenval('X')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.x = constrain(v, X_MIN_POS, X_MAX_POS); }
91
-    if (parser.seenval('Y')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.y = constrain(v, Y_MIN_POS, Y_MAX_POS); }
94
+    #if HAS_Y_AXIS
95
+      if (parser.seenval('Y')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.y = constrain(v, Y_MIN_POS, Y_MAX_POS); }
96
+    #endif
97
+    #if HAS_I_AXIS
98
+      if (parser.seenval('I')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.i = constrain(v, I_MIN_POS, I_MAX_POS); }
99
+    #endif
100
+    #if HAS_J_AXIS
101
+      if (parser.seenval('J')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.j = constrain(v, J_MIN_POS, J_MAX_POS); }
102
+    #endif
103
+    #if HAS_K_AXIS
104
+      if (parser.seenval('K')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.k = constrain(v, K_MIN_POS, K_MAX_POS); }
105
+    #endif
92 106
   #endif
93 107
 
94
-  if (parser.seenval('Z')) { toolchange_settings.z_raise = parser.value_linear_units(); }
108
+  #if HAS_Z_AXIS
109
+    if (parser.seenval('Z')) { toolchange_settings.z_raise = parser.value_linear_units(); }
110
+  #endif
95 111
 
96 112
   #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
97 113
     migration.target = 0;       // 0 = disabled
@@ -151,9 +167,24 @@ void GcodeSuite::M217_report(const bool forReplay/*=true*/) {
151 167
     #endif
152 168
 
153 169
     #if ENABLED(TOOLCHANGE_PARK)
170
+    {
154 171
       SERIAL_ECHOPGM(" W", LINEAR_UNIT(toolchange_settings.enable_park));
155
-      SERIAL_ECHOPGM_P(SP_X_STR, LINEAR_UNIT(toolchange_settings.change_point.x));
156
-      SERIAL_ECHOPGM_P(SP_Y_STR, LINEAR_UNIT(toolchange_settings.change_point.y));
172
+      SERIAL_ECHOPGM_P(
173
+            SP_X_STR, LINEAR_UNIT(toolchange_settings.change_point.x)
174
+        #if HAS_Y_AXIS
175
+          , SP_Y_STR, LINEAR_UNIT(toolchange_settings.change_point.y)
176
+        #endif
177
+        #if HAS_I_AXIS
178
+          , SP_I_STR, LINEAR_UNIT(toolchange_settings.change_point.i)
179
+        #endif
180
+        #if HAS_J_AXIS
181
+          , SP_J_STR, LINEAR_UNIT(toolchange_settings.change_point.j)
182
+        #endif
183
+        #if HAS_K_AXIS
184
+          , SP_K_STR, LINEAR_UNIT(toolchange_settings.change_point.k)
185
+        #endif
186
+      );
187
+    }
157 188
     #endif
158 189
 
159 190
     #if ENABLED(TOOLCHANGE_FS_PRIME_FIRST_USED)

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

@@ -24,7 +24,7 @@
24 24
 #include "../../module/planner.h"
25 25
 
26 26
 /**
27
- * M92: Set axis steps-per-unit for one or more axes, X, Y, Z, and E.
27
+ * M92: Set axis steps-per-unit for one or more axes, X, Y, Z, [I, [J, [K]]] and E.
28 28
  *      (Follows the same syntax as G92)
29 29
  *
30 30
  *      With multiple extruders use T to specify which one.

+ 4
- 2
Marlin/src/gcode/feature/digipot/M907-M910.cpp View File

@@ -39,7 +39,9 @@
39 39
 #endif
40 40
 
41 41
 /**
42
- * M907: Set digital trimpot motor current using axis codes X, Y, Z, E, B, S
42
+ * M907: Set digital trimpot motor current using axis codes X [Y] [Z] [E]
43
+ *   B<current> - Special case for 4th (E) axis
44
+ *   S<current> - Special case to set first 3 axes
43 45
  */
44 46
 void GcodeSuite::M907() {
45 47
   #if HAS_MOTOR_CURRENT_SPI
@@ -75,7 +77,7 @@ void GcodeSuite::M907() {
75 77
       if (parser.seenval('E')) stepper.set_digipot_current(2, parser.value_int());
76 78
     #endif
77 79
 
78
-  #endif
80
+  #endif // HAS_MOTOR_CURRENT_PWM
79 81
 
80 82
   #if HAS_MOTOR_CURRENT_I2C
81 83
     // this one uses actual amps in floating point

+ 12
- 3
Marlin/src/gcode/feature/pause/M125.cpp View File

@@ -49,6 +49,9 @@
49 49
  *    L<linear> = Override retract Length
50 50
  *    X<pos>    = Override park position X
51 51
  *    Y<pos>    = Override park position Y
52
+ *    A<pos>    = Override park position A (requires AXIS*_NAME 'A')
53
+ *    B<pos>    = Override park position B (requires AXIS*_NAME 'B')
54
+ *    C<pos>    = Override park position C (requires AXIS*_NAME 'C')
52 55
  *    Z<linear> = Override Z raise
53 56
  *
54 57
  *  With an LCD menu:
@@ -60,9 +63,15 @@ void GcodeSuite::M125() {
60 63
 
61 64
   xyz_pos_t park_point = NOZZLE_PARK_POINT;
62 65
 
63
-  // Move XY axes to filament change position or given position
64
-  if (parser.seenval('X')) park_point.x = RAW_X_POSITION(parser.linearval('X'));
65
-  if (parser.seenval('Y')) park_point.y = RAW_X_POSITION(parser.linearval('Y'));
66
+  // Move to filament change position or given position
67
+  LINEAR_AXIS_CODE(
68
+    if (parser.seenval('X')) park_point.x = RAW_X_POSITION(parser.linearval('X')),
69
+    if (parser.seenval('Y')) park_point.y = RAW_Y_POSITION(parser.linearval('Y')),
70
+    NOOP,
71
+    if (parser.seenval(AXIS4_NAME)) park_point.i = RAW_I_POSITION(parser.linearval(AXIS4_NAME)),
72
+    if (parser.seenval(AXIS5_NAME)) park_point.j = RAW_J_POSITION(parser.linearval(AXIS5_NAME)),
73
+    if (parser.seenval(AXIS6_NAME)) park_point.k = RAW_K_POSITION(parser.linearval(AXIS6_NAME))
74
+  );
66 75
 
67 76
   // Lift Z axis
68 77
   if (parser.seenval('Z')) park_point.z = parser.linearval('Z');

+ 11
- 7
Marlin/src/gcode/feature/pause/M600.cpp View File

@@ -101,10 +101,8 @@ void GcodeSuite::M600() {
101 101
   if (standardM600)
102 102
     ui.pause_show_message(PAUSE_MESSAGE_CHANGING, PAUSE_MODE_PAUSE_PRINT, target_extruder);
103 103
 
104
-  #if ENABLED(HOME_BEFORE_FILAMENT_CHANGE)
105
-    // If needed, home before parking for filament change
106
-    home_if_needed(true);
107
-  #endif
104
+  // If needed, home before parking for filament change
105
+  TERN_(HOME_BEFORE_FILAMENT_CHANGE, home_if_needed(true));
108 106
 
109 107
   #if HAS_MULTI_EXTRUDER
110 108
     // Change toolhead if specified
@@ -118,12 +116,18 @@ void GcodeSuite::M600() {
118 116
 
119 117
   xyz_pos_t park_point NOZZLE_PARK_POINT;
120 118
 
121
-  // Lift Z axis
119
+  // Lift Z axis first
122 120
   if (parser.seenval('Z')) park_point.z = parser.linearval('Z');
123 121
 
124 122
   // Move XY axes to filament change position or given position
125
-  if (parser.seenval('X')) park_point.x = parser.linearval('X');
126
-  if (parser.seenval('Y')) park_point.y = parser.linearval('Y');
123
+  LINEAR_AXIS_CODE(
124
+    if (parser.seenval('X')) park_point.x = parser.linearval('X'),
125
+    if (parser.seenval('Y')) park_point.y = parser.linearval('Y'),
126
+    NOOP,
127
+    if (parser.seenval(AXIS4_NAME)) park_point.i = parser.linearval(AXIS4_NAME);
128
+    if (parser.seenval(AXIS5_NAME)) park_point.j = parser.linearval(AXIS5_NAME);
129
+    if (parser.seenval(AXIS6_NAME)) park_point.k = parser.linearval(AXIS6_NAME);
130
+  );
127 131
 
128 132
   #if HAS_HOTEND_OFFSET && NONE(DUAL_X_CARRIAGE, DELTA)
129 133
     park_point += hotend_offset[active_extruder];

+ 3
- 0
Marlin/src/gcode/feature/trinamic/M906.cpp View File

@@ -41,6 +41,9 @@ static void tmc_print_current(TMC &st) {
41 41
  *   X[current]  - Set mA current for X driver(s)
42 42
  *   Y[current]  - Set mA current for Y driver(s)
43 43
  *   Z[current]  - Set mA current for Z driver(s)
44
+ *   A[current]  - Set mA current for A driver(s) (Requires AXIS*_NAME 'A')
45
+ *   B[current]  - Set mA current for B driver(s) (Requires AXIS*_NAME 'B')
46
+ *   C[current]  - Set mA current for C driver(s) (Requires AXIS*_NAME 'C')
44 47
  *   E[current]  - Set mA current for E driver(s)
45 48
  *
46 49
  *   I[index]    - Axis sub-index (Omit or 0 for X, Y, Z; 1 for X2, Y2, Z2; 2 for Z3; 3 for Z4.)

+ 4
- 4
Marlin/src/gcode/geometry/G92.cpp View File

@@ -29,7 +29,7 @@
29 29
 #endif
30 30
 
31 31
 /**
32
- * G92: Set the Current Position to the given X Y Z E values.
32
+ * G92: Set the Current Position to the given X [Y [Z [A [B [C [E]]]]]] values.
33 33
  *
34 34
  * Behind the scenes the G92 command may modify the Current Position
35 35
  * or the Position Shift depending on settings and sub-commands.
@@ -37,14 +37,14 @@
37 37
  * Since E has no Workspace Offset, it is always set directly.
38 38
  *
39 39
  * Without Workspace Offsets (e.g., with NO_WORKSPACE_OFFSETS):
40
- *   G92   : Set NATIVE Current Position to the given X Y Z E.
40
+ *   G92   : Set NATIVE Current Position to the given X [Y [Z [A [B [C [E]]]]]].
41 41
  *
42 42
  * Using Workspace Offsets (default Marlin behavior):
43
- *   G92   : Modify Workspace Offsets so the reported position shows the given X Y Z E.
43
+ *   G92   : Modify Workspace Offsets so the reported position shows the given X [Y [Z [A [B [C [E]]]]]].
44 44
  *   G92.1 : Zero XYZ Workspace Offsets (so the reported position = the native position).
45 45
  *
46 46
  * With POWER_LOSS_RECOVERY:
47
- *   G92.9 : Set NATIVE Current Position to the given X Y Z E.
47
+ *   G92.9 : Set NATIVE Current Position to the given X [Y [Z [A [B [C [E]]]]]].
48 48
  */
49 49
 void GcodeSuite::G92() {
50 50
 

+ 1
- 0
Marlin/src/inc/Conditionals_post.h View File

@@ -2214,6 +2214,7 @@
2214 2214
 #define TMC_UART_IS(A,N) (defined(A##_HARDWARE_SERIAL) && (CAT(HW_,A##_HARDWARE_SERIAL) == HW_Serial##N || CAT(HW_,A##_HARDWARE_SERIAL) == HW_MSerial##N))
2215 2215
 #define ANY_SERIAL_IS(N) (  CONF_SERIAL_IS(N) \
2216 2216
                          || TMC_UART_IS(X,  N) || TMC_UART_IS(Y , N) || TMC_UART_IS(Z , N) \
2217
+                         || TMC_UART_IS(I,  N) || TMC_UART_IS(J , N) || TMC_UART_IS(K , N) \
2217 2218
                          || TMC_UART_IS(X2, N) || TMC_UART_IS(Y2, N) || TMC_UART_IS(Z2, N) || TMC_UART_IS(Z3, N) || TMC_UART_IS(Z4, N) \
2218 2219
                          || TMC_UART_IS(E0, N) || TMC_UART_IS(E1, N) || TMC_UART_IS(E2, N) || TMC_UART_IS(E3, N) || TMC_UART_IS(E4, N) )
2219 2220
 

+ 14
- 21
Marlin/src/inc/SanityCheck.h View File

@@ -791,6 +791,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
791 791
   #error "Enable only one of ENDSTOPPULLUP_Y_MAX or ENDSTOPPULLDOWN_Y_MAX."
792 792
 #elif BOTH(ENDSTOPPULLUP_ZMAX, ENDSTOPPULLDOWN_ZMAX)
793 793
   #error "Enable only one of ENDSTOPPULLUP_Z_MAX or ENDSTOPPULLDOWN_Z_MAX."
794
+#elif BOTH(ENDSTOPPULLUP_IMAX, ENDSTOPPULLDOWN_IMAX)
795
+  #error "Enable only one of ENDSTOPPULLUP_I_MAX or ENDSTOPPULLDOWN_I_MAX."
796
+#elif BOTH(ENDSTOPPULLUP_JMAX, ENDSTOPPULLDOWN_JMAX)
797
+  #error "Enable only one of ENDSTOPPULLUP_J_MAX or ENDSTOPPULLDOWN_J_MAX."
798
+#elif BOTH(ENDSTOPPULLUP_KMAX, ENDSTOPPULLDOWN_KMAX)
799
+  #error "Enable only one of ENDSTOPPULLUP_K_MAX or ENDSTOPPULLDOWN_K_MAX."
794 800
 #elif BOTH(ENDSTOPPULLUP_XMIN, ENDSTOPPULLDOWN_XMIN)
795 801
   #error "Enable only one of ENDSTOPPULLUP_X_MIN or ENDSTOPPULLDOWN_X_MIN."
796 802
 #elif BOTH(ENDSTOPPULLUP_YMIN, ENDSTOPPULLDOWN_YMIN)
@@ -1417,9 +1423,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1417 1423
  * Allow only extra axis codes that do not conflict with G-code parameter names
1418 1424
  */
1419 1425
 #if HAS_I_AXIS
1420
-  #if AXIS4_NAME != 'A' && AXIS4_NAME != 'B' && AXIS4_NAME != 'C' && AXIS4_NAME != 'U' && AXIS4_NAME != 'V' && AXIS4_NAME != 'W'
1421
-    #error "AXIS4_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
1422
-  #elif !defined(I_MIN_POS) || !defined(I_MAX_POS)
1426
+  #if !defined(I_MIN_POS) || !defined(I_MAX_POS)
1423 1427
     #error "I_MIN_POS and I_MAX_POS are required with LINEAR_AXES >= 4."
1424 1428
   #elif !defined(I_HOME_DIR)
1425 1429
     #error "I_HOME_DIR is required with LINEAR_AXES >= 4."
@@ -1430,8 +1434,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1430 1434
 #if HAS_J_AXIS
1431 1435
   #if AXIS5_NAME == AXIS4_NAME
1432 1436
     #error "AXIS5_NAME must be unique."
1433
-  #elif AXIS5_NAME != 'A' && AXIS5_NAME != 'B' && AXIS5_NAME != 'C' && AXIS5_NAME != 'U' && AXIS5_NAME != 'V' && AXIS5_NAME != 'W'
1434
-    #error "AXIS5_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
1435 1437
   #elif !defined(J_MIN_POS) || !defined(J_MAX_POS)
1436 1438
     #error "J_MIN_POS and J_MAX_POS are required with LINEAR_AXES >= 5."
1437 1439
   #elif !defined(J_HOME_DIR)
@@ -1443,8 +1445,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1443 1445
 #if HAS_K_AXIS
1444 1446
   #if AXIS6_NAME == AXIS5_NAME || AXIS6_NAME == AXIS4_NAME
1445 1447
     #error "AXIS6_NAME must be unique."
1446
-  #elif AXIS6_NAME != 'A' && AXIS6_NAME != 'B' && AXIS6_NAME != 'C' && AXIS6_NAME != 'U' && AXIS6_NAME != 'V' && AXIS6_NAME != 'W'
1447
-    #error "AXIS6_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
1448 1448
   #elif !defined(K_MIN_POS) || !defined(K_MAX_POS)
1449 1449
     #error "K_MIN_POS and K_MAX_POS are required with LINEAR_AXES >= 6."
1450 1450
   #elif !defined(K_HOME_DIR)
@@ -3317,7 +3317,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
3317 3317
  * L64XX requirement
3318 3318
  */
3319 3319
 #if HAS_L64XX && HAS_I_AXIS
3320
-  #error "L64XX requires LINEAR_AXES 3. Homing with L64XX is not yet implemented for LINEAR_AXES > 3."
3320
+  #error "L64XX requires LINEAR_AXES <= 3. Homing with L64XX is not yet implemented for LINEAR_AXES > 3."
3321 3321
 #endif
3322 3322
 
3323 3323
 /**
@@ -3793,22 +3793,15 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
3793 3793
 #if _BAD_DRIVER(Z)
3794 3794
   #error "Z_DRIVER_TYPE is not recognized."
3795 3795
 #endif
3796
-#if HAS_I_AXIS
3797
-  #if _BAD_DRIVER(I)
3798
-    #error "I_DRIVER_TYPE is not recognized."
3799
-  #endif
3796
+#if _BAD_DRIVER(I)
3797
+  #error "I_DRIVER_TYPE is not recognized."
3800 3798
 #endif
3801
-#if HAS_J_AXIS
3802
-  #if _BAD_DRIVER(J)
3803
-    #error "J_DRIVER_TYPE is not recognized."
3804
-  #endif
3799
+#if _BAD_DRIVER(J)
3800
+  #error "J_DRIVER_TYPE is not recognized."
3805 3801
 #endif
3806
-#if HAS_K_AXIS
3807
-  #if _BAD_DRIVER(K)
3808
-    #error "K_DRIVER_TYPE is not recognized."
3809
-  #endif
3802
+#if _BAD_DRIVER(K)
3803
+  #error "K_DRIVER_TYPE is not recognized."
3810 3804
 #endif
3811
-
3812 3805
 #if _BAD_DRIVER(X2)
3813 3806
   #error "X2_DRIVER_TYPE is not recognized."
3814 3807
 #endif

+ 1
- 1
Marlin/src/module/endstops.cpp View File

@@ -558,7 +558,7 @@ void _O2 Endstops::report_states() {
558 558
   #if HAS_J_MAX
559 559
     ES_REPORT(J_MAX);
560 560
   #endif
561
-    #if HAS_K_MIN
561
+  #if HAS_K_MIN
562 562
     ES_REPORT(K_MIN);
563 563
   #endif
564 564
   #if HAS_K_MAX

+ 56
- 32
Marlin/src/module/motion.cpp View File

@@ -467,8 +467,8 @@ void _internal_move_to_destination(const_feedRate_t fr_mm_s/*=0.0f*/
467 467
 }
468 468
 
469 469
 /**
470
- * Plan a move to (X, Y, Z, [I, [J, [K]]]) and set the current_position
471
- * Plan a move to (X, Y, Z) with separation of Z from other components.
470
+ * Plan a move to (X, Y, Z, [I, [J, [K...]]]) and set the current_position
471
+ * Plan a move to (X, Y, Z, [I, [J, [K...]]]) with separation of Z from other components.
472 472
  *
473 473
  * - If Z is moving up, the Z move is done before XY, etc.
474 474
  * - If Z is moving down, the Z move is done after XY, etc.
@@ -484,6 +484,15 @@ void do_blocking_move_to(LINEAR_AXIS_ARGS(const float), const_feedRate_t fr_mm_s
484 484
   #if HAS_Z_AXIS
485 485
     const feedRate_t z_feedrate = fr_mm_s ?: homing_feedrate(Z_AXIS);
486 486
   #endif
487
+  #if HAS_I_AXIS
488
+    const feedRate_t i_feedrate = fr_mm_s ?: homing_feedrate(I_AXIS);
489
+  #endif
490
+  #if HAS_J_AXIS
491
+    const feedRate_t j_feedrate = fr_mm_s ?: homing_feedrate(J_AXIS);
492
+  #endif
493
+  #if HAS_K_AXIS
494
+    const feedRate_t k_feedrate = fr_mm_s ?: homing_feedrate(K_AXIS);
495
+  #endif
487 496
 
488 497
   #if IS_KINEMATIC
489 498
     if (!position_is_reachable(x, y)) return;
@@ -498,8 +507,8 @@ void do_blocking_move_to(LINEAR_AXIS_ARGS(const float), const_feedRate_t fr_mm_s
498 507
 
499 508
     // when in the danger zone
500 509
     if (current_position.z > delta_clip_start_height) {
501
-      if (z > delta_clip_start_height) {                     // staying in the danger zone
502
-        destination.set(x, y, z);                          // move directly (uninterpolated)
510
+      if (z > delta_clip_start_height) {                      // staying in the danger zone
511
+        destination.set(x, y, z);                             // move directly (uninterpolated)
503 512
         prepare_internal_fast_move_to_destination();          // set current_position from destination
504 513
         if (DEBUGGING(LEVELING)) DEBUG_POS("danger zone move", current_position);
505 514
         return;
@@ -509,7 +518,7 @@ void do_blocking_move_to(LINEAR_AXIS_ARGS(const float), const_feedRate_t fr_mm_s
509 518
       if (DEBUGGING(LEVELING)) DEBUG_POS("zone border move", current_position);
510 519
     }
511 520
 
512
-    if (z > current_position.z) {                            // raising?
521
+    if (z > current_position.z) {                             // raising?
513 522
       destination.z = z;
514 523
       prepare_internal_fast_move_to_destination(z_feedrate);  // set current_position from destination
515 524
       if (DEBUGGING(LEVELING)) DEBUG_POS("z raise move", current_position);
@@ -519,7 +528,7 @@ void do_blocking_move_to(LINEAR_AXIS_ARGS(const float), const_feedRate_t fr_mm_s
519 528
     prepare_internal_move_to_destination();                   // set current_position from destination
520 529
     if (DEBUGGING(LEVELING)) DEBUG_POS("xy move", current_position);
521 530
 
522
-    if (z < current_position.z) {                            // lowering?
531
+    if (z < current_position.z) {                             // lowering?
523 532
       destination.z = z;
524 533
       prepare_internal_fast_move_to_destination(z_feedrate);  // set current_position from destination
525 534
       if (DEBUGGING(LEVELING)) DEBUG_POS("z lower move", current_position);
@@ -528,39 +537,32 @@ void do_blocking_move_to(LINEAR_AXIS_ARGS(const float), const_feedRate_t fr_mm_s
528 537
   #elif IS_SCARA
529 538
 
530 539
     // If Z needs to raise, do it before moving XY
531
-    if (destination.z < z) {
532
-      destination.z = z;
533
-      prepare_internal_fast_move_to_destination(z_feedrate);
534
-    }
540
+    if (destination.z < z) { destination.z = z; prepare_internal_fast_move_to_destination(z_feedrate); }
535 541
 
536
-    destination.set(x, y);
537
-    prepare_internal_fast_move_to_destination(xy_feedrate);
542
+    destination.set(x, y); prepare_internal_fast_move_to_destination(xy_feedrate);
538 543
 
539 544
     // If Z needs to lower, do it after moving XY
540
-    if (destination.z > z) {
541
-      destination.z = z;
542
-      prepare_internal_fast_move_to_destination(z_feedrate);
543
-    }
545
+    if (destination.z > z) { destination.z = z; prepare_internal_fast_move_to_destination(z_feedrate); }
544 546
 
545 547
   #else
546 548
 
547
-    #if HAS_Z_AXIS
548
-      // If Z needs to raise, do it before moving XY
549
-      if (current_position.z < z) {
550
-        current_position.z = z;
551
-        line_to_current_position(z_feedrate);
552
-      }
549
+    #if HAS_Z_AXIS  // If Z needs to raise, do it before moving XY
550
+      if (current_position.z < z) { current_position.z = z; line_to_current_position(z_feedrate); }
553 551
     #endif
554 552
 
555
-    current_position.set(x, y);
556
-    line_to_current_position(xy_feedrate);
553
+    current_position.set(x, y); line_to_current_position(xy_feedrate);
557 554
 
558
-    #if HAS_Z_AXIS
559
-      // If Z needs to lower, do it after moving XY
560
-      if (current_position.z > z) {
561
-        current_position.z = z;
562
-        line_to_current_position(z_feedrate);
563
-      }
555
+    #if HAS_I_AXIS
556
+      current_position.i = i; line_to_current_position(i_feedrate);
557
+    #endif
558
+    #if HAS_J_AXIS
559
+      current_position.j = j; line_to_current_position(j_feedrate);
560
+    #endif
561
+    #if HAS_K_AXIS
562
+      current_position.k = k; line_to_current_position(k_feedrate);
563
+    #endif
564
+    #if HAS_Z_AXIS  // If Z needs to lower, do it after moving XY...
565
+      if (current_position.z > z) { current_position.z = z; line_to_current_position(z_feedrate); }
564 566
     #endif
565 567
 
566 568
   #endif
@@ -1402,6 +1404,15 @@ void prepare_line_to_destination() {
1402 1404
             #endif
1403 1405
             break;
1404 1406
         #endif
1407
+        #if I_SENSORLESS
1408
+          case I_AXIS: stealth_states.i = tmc_enable_stallguard(stepperI); break;
1409
+        #endif
1410
+        #if J_SENSORLESS
1411
+          case J_AXIS: stealth_states.j = tmc_enable_stallguard(stepperJ); break;
1412
+        #endif
1413
+        #if K_SENSORLESS
1414
+          case K_AXIS: stealth_states.k = tmc_enable_stallguard(stepperK); break;
1415
+        #endif
1405 1416
       }
1406 1417
 
1407 1418
       #if ENABLED(SPI_ENDSTOPS)
@@ -1479,6 +1490,15 @@ void prepare_line_to_destination() {
1479 1490
             #endif
1480 1491
             break;
1481 1492
         #endif
1493
+        #if I_SENSORLESS
1494
+          case I_AXIS: tmc_disable_stallguard(stepperI, enable_stealth.i); break;
1495
+        #endif
1496
+        #if J_SENSORLESS
1497
+          case J_AXIS: tmc_disable_stallguard(stepperJ, enable_stealth.j); break;
1498
+        #endif
1499
+        #if K_SENSORLESS
1500
+          case K_AXIS: tmc_disable_stallguard(stepperK, enable_stealth.k); break;
1501
+        #endif
1482 1502
       }
1483 1503
 
1484 1504
       #if ENABLED(SPI_ENDSTOPS)
@@ -1815,8 +1835,12 @@ void prepare_line_to_destination() {
1815 1835
         switch (axis) {
1816 1836
           default:
1817 1837
           case X_AXIS: es = X_ENDSTOP; break;
1818
-          case Y_AXIS: es = Y_ENDSTOP; break;
1819
-          case Z_AXIS: es = Z_ENDSTOP; break;
1838
+          #if HAS_Y_AXIS
1839
+            case Y_AXIS: es = Y_ENDSTOP; break;
1840
+          #endif
1841
+          #if HAS_Z_AXIS
1842
+            case Z_AXIS: es = Z_ENDSTOP; break;
1843
+          #endif
1820 1844
           #if HAS_I_AXIS
1821 1845
             case I_AXIS: es = I_ENDSTOP; break;
1822 1846
           #endif

+ 9
- 21
Marlin/src/module/planner.cpp View File

@@ -2041,15 +2041,9 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2041 2041
       steps_dist_mm.b      = (db + dc) * mm_per_step[B_AXIS];
2042 2042
       steps_dist_mm.c      = CORESIGN(db - dc) * mm_per_step[C_AXIS];
2043 2043
     #endif
2044
-    #if HAS_I_AXIS
2045
-      steps_dist_mm.i = di * mm_per_step[I_AXIS];
2046
-    #endif
2047
-    #if HAS_J_AXIS
2048
-      steps_dist_mm.j = dj * mm_per_step[J_AXIS];
2049
-    #endif
2050
-    #if HAS_K_AXIS
2051
-      steps_dist_mm.k = dk * mm_per_step[K_AXIS];
2052
-    #endif
2044
+    TERN_(HAS_I_AXIS, steps_dist_mm.i = di * mm_per_step[I_AXIS]);
2045
+    TERN_(HAS_J_AXIS, steps_dist_mm.j = dj * mm_per_step[J_AXIS]);
2046
+    TERN_(HAS_K_AXIS, steps_dist_mm.k = dk * mm_per_step[K_AXIS]);
2053 2047
   #elif ENABLED(MARKFORGED_XY)
2054 2048
     steps_dist_mm.a      = (da - db) * mm_per_step[A_AXIS];
2055 2049
     steps_dist_mm.b      = db * mm_per_step[B_AXIS];
@@ -2197,15 +2191,9 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2197 2191
     );
2198 2192
   #endif
2199 2193
   #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
2200
-    #if HAS_I_AXIS
2201
-      if (block->steps.i) stepper.enable_axis(I_AXIS);
2202
-    #endif
2203
-    #if HAS_J_AXIS
2204
-      if (block->steps.j) stepper.enable_axis(J_AXIS);
2205
-    #endif
2206
-    #if HAS_K_AXIS
2207
-      if (block->steps.k) stepper.enable_axis(K_AXIS);
2208
-    #endif
2194
+    TERN_(HAS_I_AXIS, if (block->steps.i) stepper.enable_axis(I_AXIS));
2195
+    TERN_(HAS_J_AXIS, if (block->steps.j) stepper.enable_axis(J_AXIS));
2196
+    TERN_(HAS_K_AXIS, if (block->steps.k) stepper.enable_axis(K_AXIS));
2209 2197
   #endif
2210 2198
 
2211 2199
   // Enable extruder(s)
@@ -2260,7 +2248,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2260 2248
 
2261 2249
   // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill
2262 2250
   #if EITHER(SLOWDOWN, HAS_WIRED_LCD) || defined(XY_FREQUENCY_LIMIT)
2263
-    // Segment time im micro seconds
2251
+    // Segment time in microseconds
2264 2252
     int32_t segment_time_us = LROUND(1000000.0f / inverse_secs);
2265 2253
   #endif
2266 2254
 
@@ -2419,7 +2407,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2419 2407
     accel = CEIL((esteps ? settings.acceleration : settings.travel_acceleration) * steps_per_mm);
2420 2408
 
2421 2409
     #if ENABLED(LIN_ADVANCE)
2422
-
2410
+      // Linear advance is currently not ready for HAS_I_AXIS
2423 2411
       #define MAX_E_JERK(N) TERN(HAS_LINEAR_E_JERK, max_e_jerk[E_INDEX_N(N)], max_jerk.e)
2424 2412
 
2425 2413
       /**
@@ -2939,7 +2927,7 @@ bool Planner::buffer_segment(const abce_pos_t &abce
2939 2927
       SERIAL_ECHOPGM_P(SP_Y_LBL, abce.b);
2940 2928
     #endif
2941 2929
     SERIAL_ECHOPGM(" (", position.y, "->", target.y);
2942
-    #if LINEAR_AXES >= ABC
2930
+    #if HAS_Z_AXIS
2943 2931
       #if ENABLED(DELTA)
2944 2932
         SERIAL_ECHOPGM(") C:", abce.c);
2945 2933
       #else

+ 4
- 1
Marlin/src/module/probe.cpp View File

@@ -787,7 +787,10 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
787 787
   #endif
788 788
 
789 789
   // On delta keep Z below clip height or do_blocking_move_to will abort
790
-  xyz_pos_t npos = { rx, ry, TERN(DELTA, _MIN(delta_clip_start_height, current_position.z), current_position.z) };
790
+  xyz_pos_t npos = LINEAR_AXIS_ARRAY(
791
+    rx, ry, TERN(DELTA, _MIN(delta_clip_start_height, current_position.z), current_position.z),
792
+    current_position.i, current_position.j, current_position.k
793
+  );
791 794
   if (!can_reach(npos, probe_relative)) {
792 795
     if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Position Not Reachable");
793 796
     return NAN;

+ 43
- 41
Marlin/src/module/stepper.cpp View File

@@ -522,7 +522,7 @@ bool Stepper::disable_axis(const AxisEnum axis) {
522 522
     }
523 523
   }
524 524
 
525
-  bool Stepper::disable_extruder(E_TERN_(const uint8_t eindex)) {
525
+  bool Stepper::disable_extruder(E_TERN_(const uint8_t eindex/*=0*/)) {
526 526
     IF_DISABLED(HAS_MULTI_EXTRUDER, constexpr uint8_t eindex = 0);
527 527
     mark_axis_disabled(E_AXIS E_OPTARG(eindex));
528 528
     const bool can_disable = can_axis_disable(E_AXIS E_OPTARG(eindex));
@@ -1688,7 +1688,7 @@ void Stepper::pulse_phase_isr() {
1688 1688
     const bool is_page = IS_PAGE(current_block);
1689 1689
 
1690 1690
     #if ENABLED(DIRECT_STEPPING)
1691
-      // TODO (DerAndere): Add support for HAS_I_AXIS
1691
+      // Direct stepping is currently not ready for HAS_I_AXIS
1692 1692
       if (is_page) {
1693 1693
 
1694 1694
         #if STEPPER_PAGE_FORMAT == SP_4x4D_128
@@ -1929,7 +1929,7 @@ uint32_t Stepper::block_phase_isr() {
1929 1929
     // If current block is finished, reset pointer and finalize state
1930 1930
     if (step_events_completed >= step_event_count) {
1931 1931
       #if ENABLED(DIRECT_STEPPING)
1932
-        // TODO (DerAndere): Add support for HAS_I_AXIS
1932
+        // Direct stepping is currently not ready for HAS_I_AXIS
1933 1933
         #if STEPPER_PAGE_FORMAT == SP_4x4D_128
1934 1934
           #define PAGE_SEGMENT_UPDATE_POS(AXIS) \
1935 1935
             count_position[_AXIS(AXIS)] += page_step_state.bd[_AXIS(AXIS)] - 128 * 7;
@@ -3352,113 +3352,115 @@ void Stepper::report_positions() {
3352 3352
 
3353 3353
   void Stepper::microstep_init() {
3354 3354
     #if HAS_X_MS_PINS
3355
-      SET_OUTPUT(X_MS1_PIN);
3356
-      SET_OUTPUT(X_MS2_PIN);
3355
+      SET_OUTPUT(X_MS1_PIN); SET_OUTPUT(X_MS2_PIN);
3357 3356
       #if PIN_EXISTS(X_MS3)
3358 3357
         SET_OUTPUT(X_MS3_PIN);
3359 3358
       #endif
3360 3359
     #endif
3361 3360
     #if HAS_X2_MS_PINS
3362
-      SET_OUTPUT(X2_MS1_PIN);
3363
-      SET_OUTPUT(X2_MS2_PIN);
3361
+      SET_OUTPUT(X2_MS1_PIN); SET_OUTPUT(X2_MS2_PIN);
3364 3362
       #if PIN_EXISTS(X2_MS3)
3365 3363
         SET_OUTPUT(X2_MS3_PIN);
3366 3364
       #endif
3367 3365
     #endif
3368 3366
     #if HAS_Y_MS_PINS
3369
-      SET_OUTPUT(Y_MS1_PIN);
3370
-      SET_OUTPUT(Y_MS2_PIN);
3367
+      SET_OUTPUT(Y_MS1_PIN); SET_OUTPUT(Y_MS2_PIN);
3371 3368
       #if PIN_EXISTS(Y_MS3)
3372 3369
         SET_OUTPUT(Y_MS3_PIN);
3373 3370
       #endif
3374 3371
     #endif
3375 3372
     #if HAS_Y2_MS_PINS
3376
-      SET_OUTPUT(Y2_MS1_PIN);
3377
-      SET_OUTPUT(Y2_MS2_PIN);
3373
+      SET_OUTPUT(Y2_MS1_PIN); SET_OUTPUT(Y2_MS2_PIN);
3378 3374
       #if PIN_EXISTS(Y2_MS3)
3379 3375
         SET_OUTPUT(Y2_MS3_PIN);
3380 3376
       #endif
3381 3377
     #endif
3382 3378
     #if HAS_Z_MS_PINS
3383
-      SET_OUTPUT(Z_MS1_PIN);
3384
-      SET_OUTPUT(Z_MS2_PIN);
3379
+      SET_OUTPUT(Z_MS1_PIN); SET_OUTPUT(Z_MS2_PIN);
3385 3380
       #if PIN_EXISTS(Z_MS3)
3386 3381
         SET_OUTPUT(Z_MS3_PIN);
3387 3382
       #endif
3388 3383
     #endif
3389 3384
     #if HAS_Z2_MS_PINS
3390
-      SET_OUTPUT(Z2_MS1_PIN);
3391
-      SET_OUTPUT(Z2_MS2_PIN);
3385
+      SET_OUTPUT(Z2_MS1_PIN); SET_OUTPUT(Z2_MS2_PIN);
3392 3386
       #if PIN_EXISTS(Z2_MS3)
3393 3387
         SET_OUTPUT(Z2_MS3_PIN);
3394 3388
       #endif
3395 3389
     #endif
3396 3390
     #if HAS_Z3_MS_PINS
3397
-      SET_OUTPUT(Z3_MS1_PIN);
3398
-      SET_OUTPUT(Z3_MS2_PIN);
3391
+      SET_OUTPUT(Z3_MS1_PIN); SET_OUTPUT(Z3_MS2_PIN);
3399 3392
       #if PIN_EXISTS(Z3_MS3)
3400 3393
         SET_OUTPUT(Z3_MS3_PIN);
3401 3394
       #endif
3402 3395
     #endif
3403 3396
     #if HAS_Z4_MS_PINS
3404
-      SET_OUTPUT(Z4_MS1_PIN);
3405
-      SET_OUTPUT(Z4_MS2_PIN);
3397
+      SET_OUTPUT(Z4_MS1_PIN); SET_OUTPUT(Z4_MS2_PIN);
3406 3398
       #if PIN_EXISTS(Z4_MS3)
3407 3399
         SET_OUTPUT(Z4_MS3_PIN);
3408 3400
       #endif
3409 3401
     #endif
3402
+    #if HAS_I_MS_PINS
3403
+      SET_OUTPUT(I_MS1_PIN); SET_OUTPUT(I_MS2_PIN);
3404
+      #if PIN_EXISTS(I_MS3)
3405
+        SET_OUTPUT(I_MS3_PIN);
3406
+      #endif
3407
+    #endif
3408
+    #if HAS_J_MS_PINS
3409
+      SET_OUTPUT(J_MS1_PIN); SET_OUTPUT(J_MS2_PIN);
3410
+      #if PIN_EXISTS(J_MS3)
3411
+        SET_OUTPUT(J_MS3_PIN);
3412
+      #endif
3413
+    #endif
3414
+    #if HAS_K_MS_PINS
3415
+      SET_OUTPUT(K_MS1_PIN); SET_OUTPUT(K_MS2_PIN);
3416
+      #if PIN_EXISTS(K_MS3)
3417
+        SET_OUTPUT(K_MS3_PIN);
3418
+      #endif
3419
+    #endif
3410 3420
     #if HAS_E0_MS_PINS
3411
-      SET_OUTPUT(E0_MS1_PIN);
3412
-      SET_OUTPUT(E0_MS2_PIN);
3421
+      SET_OUTPUT(E0_MS1_PIN); SET_OUTPUT(E0_MS2_PIN);
3413 3422
       #if PIN_EXISTS(E0_MS3)
3414 3423
         SET_OUTPUT(E0_MS3_PIN);
3415 3424
       #endif
3416 3425
     #endif
3417 3426
     #if HAS_E1_MS_PINS
3418
-      SET_OUTPUT(E1_MS1_PIN);
3419
-      SET_OUTPUT(E1_MS2_PIN);
3427
+      SET_OUTPUT(E1_MS1_PIN); SET_OUTPUT(E1_MS2_PIN);
3420 3428
       #if PIN_EXISTS(E1_MS3)
3421 3429
         SET_OUTPUT(E1_MS3_PIN);
3422 3430
       #endif
3423 3431
     #endif
3424 3432
     #if HAS_E2_MS_PINS
3425
-      SET_OUTPUT(E2_MS1_PIN);
3426
-      SET_OUTPUT(E2_MS2_PIN);
3433
+      SET_OUTPUT(E2_MS1_PIN); SET_OUTPUT(E2_MS2_PIN);
3427 3434
       #if PIN_EXISTS(E2_MS3)
3428 3435
         SET_OUTPUT(E2_MS3_PIN);
3429 3436
       #endif
3430 3437
     #endif
3431 3438
     #if HAS_E3_MS_PINS
3432
-      SET_OUTPUT(E3_MS1_PIN);
3433
-      SET_OUTPUT(E3_MS2_PIN);
3439
+      SET_OUTPUT(E3_MS1_PIN); SET_OUTPUT(E3_MS2_PIN);
3434 3440
       #if PIN_EXISTS(E3_MS3)
3435 3441
         SET_OUTPUT(E3_MS3_PIN);
3436 3442
       #endif
3437 3443
     #endif
3438 3444
     #if HAS_E4_MS_PINS
3439
-      SET_OUTPUT(E4_MS1_PIN);
3440
-      SET_OUTPUT(E4_MS2_PIN);
3445
+      SET_OUTPUT(E4_MS1_PIN); SET_OUTPUT(E4_MS2_PIN);
3441 3446
       #if PIN_EXISTS(E4_MS3)
3442 3447
         SET_OUTPUT(E4_MS3_PIN);
3443 3448
       #endif
3444 3449
     #endif
3445 3450
     #if HAS_E5_MS_PINS
3446
-      SET_OUTPUT(E5_MS1_PIN);
3447
-      SET_OUTPUT(E5_MS2_PIN);
3451
+      SET_OUTPUT(E5_MS1_PIN); SET_OUTPUT(E5_MS2_PIN);
3448 3452
       #if PIN_EXISTS(E5_MS3)
3449 3453
         SET_OUTPUT(E5_MS3_PIN);
3450 3454
       #endif
3451 3455
     #endif
3452 3456
     #if HAS_E6_MS_PINS
3453
-      SET_OUTPUT(E6_MS1_PIN);
3454
-      SET_OUTPUT(E6_MS2_PIN);
3457
+      SET_OUTPUT(E6_MS1_PIN); SET_OUTPUT(E6_MS2_PIN);
3455 3458
       #if PIN_EXISTS(E6_MS3)
3456 3459
         SET_OUTPUT(E6_MS3_PIN);
3457 3460
       #endif
3458 3461
     #endif
3459 3462
     #if HAS_E7_MS_PINS
3460
-      SET_OUTPUT(E7_MS1_PIN);
3461
-      SET_OUTPUT(E7_MS2_PIN);
3463
+      SET_OUTPUT(E7_MS1_PIN); SET_OUTPUT(E7_MS2_PIN);
3462 3464
       #if PIN_EXISTS(E7_MS3)
3463 3465
         SET_OUTPUT(E7_MS3_PIN);
3464 3466
       #endif
@@ -3531,13 +3533,13 @@ void Stepper::report_positions() {
3531 3533
       #if HAS_E7_MS_PINS
3532 3534
         case 10: WRITE(E7_MS1_PIN, ms1); break;
3533 3535
       #endif
3534
-      #if HAS_I_MICROSTEPS
3536
+      #if HAS_I_MS_PINS
3535 3537
         case 11: WRITE(I_MS1_PIN, ms1); break
3536 3538
       #endif
3537
-      #if HAS_J_MICROSTEPS
3539
+      #if HAS_J_MS_PINS
3538 3540
         case 12: WRITE(J_MS1_PIN, ms1); break
3539 3541
       #endif
3540
-      #if HAS_K_MICROSTEPS
3542
+      #if HAS_K_MS_PINS
3541 3543
         case 13: WRITE(K_MS1_PIN, ms1); break
3542 3544
       #endif
3543 3545
     }
@@ -3602,13 +3604,13 @@ void Stepper::report_positions() {
3602 3604
       #if HAS_E7_MS_PINS
3603 3605
         case 10: WRITE(E7_MS2_PIN, ms2); break;
3604 3606
       #endif
3605
-      #if HAS_I_M_PINS
3607
+      #if HAS_I_MS_PINS
3606 3608
         case 11: WRITE(I_MS2_PIN, ms2); break
3607 3609
       #endif
3608
-      #if HAS_J_M_PINS
3610
+      #if HAS_J_MS_PINS
3609 3611
         case 12: WRITE(J_MS2_PIN, ms2); break
3610 3612
       #endif
3611
-      #if HAS_K_M_PINS
3613
+      #if HAS_K_MS_PINS
3612 3614
         case 13: WRITE(K_MS2_PIN, ms2); break
3613 3615
       #endif
3614 3616
     }

+ 0
- 1
Marlin/src/module/stepper.h View File

@@ -320,7 +320,6 @@ class Stepper {
320 320
         #ifndef MOTOR_CURRENT_PWM_FREQUENCY
321 321
           #define MOTOR_CURRENT_PWM_FREQUENCY 31400
322 322
         #endif
323
-
324 323
         #define MOTOR_CURRENT_COUNT LINEAR_AXES
325 324
       #elif HAS_MOTOR_CURRENT_SPI
326 325
         static constexpr uint32_t digipot_count[] = DIGIPOT_MOTOR_CURRENT;

+ 18
- 0
Marlin/src/pins/pinsDebug_list.h View File

@@ -1601,6 +1601,24 @@
1601 1601
 #if PIN_EXISTS(Z4_SERIAL_RX)
1602 1602
   REPORT_NAME_DIGITAL(__LINE__, Z4_SERIAL_RX_PIN)
1603 1603
 #endif
1604
+#if PIN_EXISTS(I_SERIAL_TX)
1605
+  REPORT_NAME_DIGITAL(__LINE__, I_SERIAL_TX_PIN)
1606
+#endif
1607
+#if PIN_EXISTS(I_SERIAL_RX)
1608
+  REPORT_NAME_DIGITAL(__LINE__, I_SERIAL_RX_PIN)
1609
+#endif
1610
+#if PIN_EXISTS(J_SERIAL_TX)
1611
+  REPORT_NAME_DIGITAL(__LINE__, J_SERIAL_TX_PIN)
1612
+#endif
1613
+#if PIN_EXISTS(J_SERIAL_RX)
1614
+  REPORT_NAME_DIGITAL(__LINE__, J_SERIAL_RX_PIN)
1615
+#endif
1616
+#if PIN_EXISTS(K_SERIAL_TX)
1617
+  REPORT_NAME_DIGITAL(__LINE__, K_SERIAL_TX_PIN)
1618
+#endif
1619
+#if PIN_EXISTS(K_SERIAL_RX)
1620
+  REPORT_NAME_DIGITAL(__LINE__, K_SERIAL_RX_PIN)
1621
+#endif
1604 1622
 #if PIN_EXISTS(E0_DIAG)
1605 1623
   REPORT_NAME_DIGITAL(__LINE__, E0_DIAG_PIN)
1606 1624
 #endif

+ 15
- 7
Marlin/src/pins/pins_postprocess.h View File

@@ -546,6 +546,7 @@
546 546
   #undef K_MAX_PIN
547 547
 #endif
548 548
 
549
+// Filament Sensor first pin alias
549 550
 #if HAS_FILAMENT_SENSOR
550 551
   #define FIL_RUNOUT1_PIN FIL_RUNOUT_PIN  // Filament Sensor first pin alias
551 552
 #else
@@ -598,12 +599,13 @@
598 599
   #define X2_E_INDEX E_STEPPERS
599 600
 #endif
600 601
 
601
-// The X2 axis, if any, should be the next open extruder port
602 602
 #if HAS_X2_STEPPER && !defined(X2_DIAG_PIN) && !defined(X2_STEP_PIN) && !PIN_EXISTS(X2_CS_PIN)
603 603
   #define Y2_E_INDEX INCREMENT(X2_E_INDEX)
604 604
 #else
605 605
   #define Y2_E_INDEX X2_E_INDEX
606 606
 #endif
607
+
608
+// The X2 axis, if any, should be the next open extruder port
607 609
 #if HAS_X2_STEPPER
608 610
   #ifndef X2_STEP_PIN
609 611
     #define X2_STEP_PIN   _EPIN(X2_E_INDEX, STEP)
@@ -686,12 +688,13 @@
686 688
   #define X2_MS3_PIN -1
687 689
 #endif
688 690
 
689
-// The Y2 axis, if any, should be the next open extruder port
690 691
 #if ENABLED(Y_DUAL_STEPPER_DRIVERS) && !defined(Y2_DIAG_PIN) && !defined(Y2_STEP_PIN) && !PIN_EXISTS(Y2_CS_PIN)
691 692
   #define Z2_E_INDEX INCREMENT(Y2_E_INDEX)
692 693
 #else
693 694
   #define Z2_E_INDEX Y2_E_INDEX
694 695
 #endif
696
+
697
+// The Y2 axis, if any, should be the next open extruder port
695 698
 #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
696 699
   #ifndef Y2_STEP_PIN
697 700
     #define Y2_STEP_PIN   _EPIN(Y2_E_INDEX, STEP)
@@ -771,12 +774,13 @@
771 774
   #define Y2_MS3_PIN -1
772 775
 #endif
773 776
 
774
-// The Z2 axis, if any, should be the next open extruder port
775 777
 #if NUM_Z_STEPPER_DRIVERS >= 2 && !defined(Z2_DIAG_PIN) && !defined(Z2_STEP_PIN) && !PIN_EXISTS(Z2_CS_PIN)
776 778
   #define Z3_E_INDEX INCREMENT(Z2_E_INDEX)
777 779
 #else
778 780
   #define Z3_E_INDEX Z2_E_INDEX
779 781
 #endif
782
+
783
+// The Z2 axis, if any, should be the next open extruder port
780 784
 #if NUM_Z_STEPPER_DRIVERS >= 2
781 785
   #ifndef Z2_STEP_PIN
782 786
     #define Z2_STEP_PIN   _EPIN(Z2_E_INDEX, STEP)
@@ -856,12 +860,13 @@
856 860
   #define Z2_MS3_PIN -1
857 861
 #endif
858 862
 
859
-// The Z3 axis, if any, should be the next open extruder port
860 863
 #if NUM_Z_STEPPER_DRIVERS >= 3 && !defined(Z3_DIAG_PIN) && !defined(Z3_STEP_PIN) && !PIN_EXISTS(Z3_CS_PIN)
861 864
   #define Z4_E_INDEX INCREMENT(Z3_E_INDEX)
862 865
 #else
863 866
   #define Z4_E_INDEX Z3_E_INDEX
864 867
 #endif
868
+
869
+// The Z3 axis, if any, should be the next open extruder port
865 870
 #if NUM_Z_STEPPER_DRIVERS >= 3
866 871
   #ifndef Z3_STEP_PIN
867 872
     #define Z3_STEP_PIN   _EPIN(Z3_E_INDEX, STEP)
@@ -941,12 +946,13 @@
941 946
   #define Z3_MS3_PIN -1
942 947
 #endif
943 948
 
944
-// The Z4 axis, if any, should be the next open extruder port
945 949
 #if NUM_Z_STEPPER_DRIVERS >= 4 && !defined(Z4_DIAG_PIN) && !defined(Z4_STEP_PIN) && !PIN_EXISTS(Z4_CS_PIN)
946 950
   #define I_E_INDEX INCREMENT(Z4_E_INDEX)
947 951
 #else
948 952
   #define I_E_INDEX Z4_E_INDEX
949 953
 #endif
954
+
955
+// The Z4 axis, if any, should be the next open extruder port
950 956
 #if NUM_Z_STEPPER_DRIVERS >= 4
951 957
   #ifndef Z4_STEP_PIN
952 958
     #define Z4_STEP_PIN   _EPIN(Z4_E_INDEX, STEP)
@@ -1026,12 +1032,13 @@
1026 1032
   #define Z4_MS3_PIN -1
1027 1033
 #endif
1028 1034
 
1029
-// The I axis, if any, should be the next open extruder port
1030 1035
 #if HAS_I_AXIS && !defined(I_DIAG_PIN) && !defined(I_STEP_PIN) && !PIN_EXISTS(I_CS_PIN)
1031 1036
   #define J_E_INDEX INCREMENT(I_E_INDEX)
1032 1037
 #else
1033 1038
   #define J_E_INDEX I_E_INDEX
1034 1039
 #endif
1040
+
1041
+// The I axis, if any, should be the next open extruder port
1035 1042
 #if HAS_I_AXIS
1036 1043
   #ifndef I_STEP_PIN
1037 1044
     #define I_STEP_PIN   _EPIN(I_E_INDEX, STEP)
@@ -1111,12 +1118,13 @@
1111 1118
   #define I_MS3_PIN -1
1112 1119
 #endif
1113 1120
 
1114
-// The J axis, if any, should be the next open extruder port
1115 1121
 #if HAS_J_AXIS && !defined(J_DIAG_PIN) && !defined(J_STEP_PIN) && !PIN_EXISTS(J_CS_PIN)
1116 1122
   #define K_E_INDEX INCREMENT(J_E_INDEX)
1117 1123
 #else
1118 1124
   #define K_E_INDEX J_E_INDEX
1119 1125
 #endif
1126
+
1127
+// The J axis, if any, should be the next open extruder port
1120 1128
 #if HAS_J_AXIS
1121 1129
   #ifndef J_STEP_PIN
1122 1130
     #define J_STEP_PIN   _EPIN(J_E_INDEX, STEP)

Loading…
Cancel
Save