Browse Source

✏️ Followup to Six Linear Axes (#22056)

DerAndere 3 years ago
parent
commit
ba4fa49834
No account linked to committer's email address

+ 2
- 2
Marlin/Configuration_adv.h View File

734
  * the position of the toolhead relative to the workspace.
734
  * the position of the toolhead relative to the workspace.
735
  */
735
  */
736
 
736
 
737
-//#define SENSORLESS_BACKOFF_MM  { 2, 2 }     // (mm) Backoff from endstops before sensorless homing
737
+//#define SENSORLESS_BACKOFF_MM  { 2, 2, 0 }  // (mm) Backoff from endstops before sensorless homing
738
 
738
 
739
 #define HOMING_BUMP_MM      { 5, 5, 2 }       // (mm) Backoff from endstops after first bump
739
 #define HOMING_BUMP_MM      { 5, 5, 2 }       // (mm) Backoff from endstops after first bump
740
 #define HOMING_BUMP_DIVISOR { 2, 2, 4 }       // Re-Bump Speed Divisor (Divides the Homing Feedrate)
740
 #define HOMING_BUMP_DIVISOR { 2, 2, 4 }       // Re-Bump Speed Divisor (Divides the Homing Feedrate)
2253
    * Extra G-code to run while executing tool-change commands. Can be used to use an additional
2253
    * Extra G-code to run while executing tool-change commands. Can be used to use an additional
2254
    * stepper motor (I axis, see option LINEAR_AXES in Configuration.h) to drive the tool-changer.
2254
    * stepper motor (I axis, see option LINEAR_AXES in Configuration.h) to drive the tool-changer.
2255
    */
2255
    */
2256
-  //#define EVENT_GCODE_TOOLCHANGE_T0 "G28 A\nG1 I0" // Extra G-code to run while executing tool-change command T0
2256
+  //#define EVENT_GCODE_TOOLCHANGE_T0 "G28 A\nG1 A0" // Extra G-code to run while executing tool-change command T0
2257
   //#define EVENT_GCODE_TOOLCHANGE_T1 "G1 A10"       // Extra G-code to run while executing tool-change command T1
2257
   //#define EVENT_GCODE_TOOLCHANGE_T1 "G1 A10"       // Extra G-code to run while executing tool-change command T1
2258
 
2258
 
2259
   /**
2259
   /**

+ 6
- 6
Marlin/src/core/macros.h View File

36
 #define _XMIN_   100
36
 #define _XMIN_   100
37
 #define _YMIN_   200
37
 #define _YMIN_   200
38
 #define _ZMIN_   300
38
 #define _ZMIN_   300
39
-#define _IMIN_   400
40
-#define _JMIN_   500
41
-#define _KMIN_   600
39
+#define _IMIN_   500
40
+#define _JMIN_   600
41
+#define _KMIN_   700
42
 #define _XMAX_   101
42
 #define _XMAX_   101
43
 #define _YMAX_   201
43
 #define _YMAX_   201
44
 #define _ZMAX_   301
44
 #define _ZMAX_   301
45
-#define _IMAX_   401
46
-#define _JMAX_   501
47
-#define _KMAX_   601
45
+#define _IMAX_   501
46
+#define _JMAX_   601
47
+#define _KMAX_   701
48
 #define _XDIAG_  102
48
 #define _XDIAG_  102
49
 #define _YDIAG_  202
49
 #define _YDIAG_  202
50
 #define _ZDIAG_  302
50
 #define _ZDIAG_  302

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

570
   #error "NEOPIXEL_BKGD_LED_INDEX is now NEOPIXEL_BKGD_INDEX_FIRST."
570
   #error "NEOPIXEL_BKGD_LED_INDEX is now NEOPIXEL_BKGD_INDEX_FIRST."
571
 #endif
571
 #endif
572
 
572
 
573
-constexpr float sbm[] = AXIS_RELATIVE_MODES;
574
-static_assert(COUNT(sbm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _LOGICAL_AXES_STR "elements.");
573
+constexpr float arm[] = AXIS_RELATIVE_MODES;
574
+static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _LOGICAL_AXES_STR "elements.");
575
 
575
 
576
 /**
576
 /**
577
  * Probe temp compensation requirements
577
  * Probe temp compensation requirements

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

223
       typedef struct {
223
       typedef struct {
224
         union {
224
         union {
225
           bool any;
225
           bool any;
226
-          struct { bool x:1, y:1, z:1; };
226
+          struct { bool LINEAR_AXIS_LIST(x:1, y:1, z:1, i:1, j:1, k:1); };
227
         };
227
         };
228
       } tmc_spi_homing_t;
228
       } tmc_spi_homing_t;
229
       static tmc_spi_homing_t tmc_spi_homing;
229
       static tmc_spi_homing_t tmc_spi_homing;

+ 57
- 22
Marlin/src/module/motion.cpp View File

588
   }
588
   }
589
 #endif
589
 #endif
590
 
590
 
591
-#if LINEAR_AXES == 4
591
+#if LINEAR_AXES >= 4
592
   void do_blocking_move_to_i(const_float_t ri, const_feedRate_t fr_mm_s/*=0.0*/) {
592
   void do_blocking_move_to_i(const_float_t ri, const_feedRate_t fr_mm_s/*=0.0*/) {
593
     do_blocking_move_to_xyz_i(current_position, ri, fr_mm_s);
593
     do_blocking_move_to_xyz_i(current_position, ri, fr_mm_s);
594
   }
594
   }
595
   void do_blocking_move_to_xyz_i(const xyze_pos_t &raw, const_float_t i, const_feedRate_t fr_mm_s/*=0.0f*/) {
595
   void do_blocking_move_to_xyz_i(const xyze_pos_t &raw, const_float_t i, const_feedRate_t fr_mm_s/*=0.0f*/) {
596
-	  do_blocking_move_to(raw.x, raw.y, raw.z, i, fr_mm_s);
596
+    do_blocking_move_to(
597
+      LINEAR_AXIS_LIST(raw.x, raw.y, raw.z, i, raw.j, raw.k),
598
+      fr_mm_s
599
+    );
597
   }
600
   }
598
 #endif
601
 #endif
599
 
602
 
600
 #if LINEAR_AXES >= 5
603
 #if LINEAR_AXES >= 5
601
-  void do_blocking_move_to_i(const_float_t ri, const_feedRate_t fr_mm_s/*=0.0*/) {
602
-    do_blocking_move_to_xyz_i(current_position, ri, fr_mm_s);
603
-  }
604
-  void do_blocking_move_to_xyz_i(const xyze_pos_t &raw, const_float_t i, const_feedRate_t fr_mm_s/*=0.0f*/) {
605
-	  do_blocking_move_to(raw.x, raw.y, raw.z, i, raw.j, fr_mm_s);
606
-  }
607
   void do_blocking_move_to_j(const_float_t rj, const_feedRate_t fr_mm_s/*=0.0*/) {
604
   void do_blocking_move_to_j(const_float_t rj, const_feedRate_t fr_mm_s/*=0.0*/) {
608
     do_blocking_move_to_xyzi_j(current_position, rj, fr_mm_s);
605
     do_blocking_move_to_xyzi_j(current_position, rj, fr_mm_s);
609
   }
606
   }
610
   void do_blocking_move_to_xyzi_j(const xyze_pos_t &raw, const_float_t j, const_feedRate_t fr_mm_s/*=0.0f*/) {
607
   void do_blocking_move_to_xyzi_j(const xyze_pos_t &raw, const_float_t j, const_feedRate_t fr_mm_s/*=0.0f*/) {
611
-    do_blocking_move_to(raw.x, raw.y, raw.z, raw.i, j, fr_mm_s);
608
+    do_blocking_move_to(
609
+      LINEAR_AXIS_LIST(raw.x, raw.y, raw.z, raw.i, j, raw.k),
610
+      fr_mm_s
611
+    );
612
   }
612
   }
613
 #endif
613
 #endif
614
 
614
 
617
     do_blocking_move_to_xyzij_k(current_position, rk, fr_mm_s);
617
     do_blocking_move_to_xyzij_k(current_position, rk, fr_mm_s);
618
   }
618
   }
619
   void do_blocking_move_to_xyzij_k(const xyze_pos_t &raw, const_float_t k, const_feedRate_t fr_mm_s/*=0.0f*/) {
619
   void do_blocking_move_to_xyzij_k(const xyze_pos_t &raw, const_float_t k, const_feedRate_t fr_mm_s/*=0.0f*/) {
620
-    do_blocking_move_to(raw.x, raw.y, raw.z, raw.i, raw.j, k, fr_mm_s);
620
+    do_blocking_move_to(
621
+      LINEAR_AXIS_LIST(raw.x, raw.y, raw.z, raw.i, raw.j, k),
622
+      fr_mm_s
623
+    );
621
   }
624
   }
622
 #endif
625
 #endif
623
 
626
 
822
         #endif
825
         #endif
823
       }
826
       }
824
     #endif
827
     #endif
825
-    #if LINEAR_AXES >= 4  // TODO (DerAndere): Find out why this was missing / removed
828
+    #if LINEAR_AXES >= 4
826
       if (axis_was_homed(I_AXIS)) {
829
       if (axis_was_homed(I_AXIS)) {
827
         #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_I)
830
         #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_I)
828
           NOLESS(target.i, soft_endstop.min.i);
831
           NOLESS(target.i, soft_endstop.min.i);
1295
 
1298
 
1296
   bool homing_needed_error(linear_axis_bits_t axis_bits/*=linear_bits*/) {
1299
   bool homing_needed_error(linear_axis_bits_t axis_bits/*=linear_bits*/) {
1297
     if ((axis_bits = axes_should_home(axis_bits))) {
1300
     if ((axis_bits = axes_should_home(axis_bits))) {
1298
-      PGM_P home_first = GET_TEXT(MSG_HOME_FIRST);  // TODO: (DerAndere) Set this up for extra axes
1301
+      PGM_P home_first = GET_TEXT(MSG_HOME_FIRST);
1299
       char msg[strlen_P(home_first)+1];
1302
       char msg[strlen_P(home_first)+1];
1300
       sprintf_P(msg, home_first,
1303
       sprintf_P(msg, home_first,
1301
         LINEAR_AXIS_LIST(
1304
         LINEAR_AXIS_LIST(
1390
       #if ENABLED(SPI_ENDSTOPS)
1393
       #if ENABLED(SPI_ENDSTOPS)
1391
         switch (axis) {
1394
         switch (axis) {
1392
           case X_AXIS: if (ENABLED(X_SPI_SENSORLESS)) endstops.tmc_spi_homing.x = true; break;
1395
           case X_AXIS: if (ENABLED(X_SPI_SENSORLESS)) endstops.tmc_spi_homing.x = true; break;
1393
-          case Y_AXIS: if (ENABLED(Y_SPI_SENSORLESS)) endstops.tmc_spi_homing.y = true; break;
1394
-          case Z_AXIS: if (ENABLED(Z_SPI_SENSORLESS)) endstops.tmc_spi_homing.z = true; break;
1396
+          #if HAS_Y_AXIS
1397
+            case Y_AXIS: if (ENABLED(Y_SPI_SENSORLESS)) endstops.tmc_spi_homing.y = true; break;
1398
+          #endif
1399
+          #if HAS_Z_AXIS
1400
+            case Z_AXIS: if (ENABLED(Z_SPI_SENSORLESS)) endstops.tmc_spi_homing.z = true; break;
1401
+          #endif
1402
+          #if LINEAR_AXES >= 4
1403
+            case I_AXIS: if (ENABLED(I_SPI_SENSORLESS)) endstops.tmc_spi_homing.i = true; break;
1404
+          #endif
1405
+          #if LINEAR_AXES >= 5
1406
+            case J_AXIS: if (ENABLED(J_SPI_SENSORLESS)) endstops.tmc_spi_homing.j = true; break;
1407
+          #endif
1408
+          #if LINEAR_AXES >= 6
1409
+            case K_AXIS: if (ENABLED(K_SPI_SENSORLESS)) endstops.tmc_spi_homing.k = true; break;
1410
+          #endif
1395
           default: break;
1411
           default: break;
1396
         }
1412
         }
1397
       #endif
1413
       #endif
1454
       #if ENABLED(SPI_ENDSTOPS)
1470
       #if ENABLED(SPI_ENDSTOPS)
1455
         switch (axis) {
1471
         switch (axis) {
1456
           case X_AXIS: if (ENABLED(X_SPI_SENSORLESS)) endstops.tmc_spi_homing.x = false; break;
1472
           case X_AXIS: if (ENABLED(X_SPI_SENSORLESS)) endstops.tmc_spi_homing.x = false; break;
1457
-          case Y_AXIS: if (ENABLED(Y_SPI_SENSORLESS)) endstops.tmc_spi_homing.y = false; break;
1458
-          case Z_AXIS: if (ENABLED(Z_SPI_SENSORLESS)) endstops.tmc_spi_homing.z = false; break;
1459
-          case I_AXIS: if (ENABLED(I_SPI_SENSORLESS)) endstops.tmc_spi_homing.i = false; break;
1460
-          case J_AXIS: if (ENABLED(J_SPI_SENSORLESS)) endstops.tmc_spi_homing.j = false; break;
1461
-          case K_AXIS: if (ENABLED(K_SPI_SENSORLESS)) endstops.tmc_spi_homing.k = false; break;
1473
+          #if HAS_Y_AXIS
1474
+            case Y_AXIS: if (ENABLED(Y_SPI_SENSORLESS)) endstops.tmc_spi_homing.y = false; break;
1475
+          #endif
1476
+          #if HAS_Z_AXIS
1477
+            case Z_AXIS: if (ENABLED(Z_SPI_SENSORLESS)) endstops.tmc_spi_homing.z = false; break;
1478
+          #endif
1479
+          #if LINEAR_AXES >= 4
1480
+            case I_AXIS: if (ENABLED(I_SPI_SENSORLESS)) endstops.tmc_spi_homing.i = false; break;
1481
+          #endif
1482
+          #if LINEAR_AXES >= 5
1483
+            case J_AXIS: if (ENABLED(J_SPI_SENSORLESS)) endstops.tmc_spi_homing.j = false; break;
1484
+          #endif
1485
+          #if LINEAR_AXES >= 6
1486
+            case K_AXIS: if (ENABLED(K_SPI_SENSORLESS)) endstops.tmc_spi_homing.k = false; break;
1487
+          #endif
1462
           default: break;
1488
           default: break;
1463
         }
1489
         }
1464
       #endif
1490
       #endif
1734
     #endif
1760
     #endif
1735
 
1761
 
1736
     //
1762
     //
1737
-    // Back away to prevent an early X/Y sensorless trigger
1763
+    // Back away to prevent an early sensorless trigger
1738
     //
1764
     //
1739
     #if DISABLED(DELTA) && defined(SENSORLESS_BACKOFF_MM)
1765
     #if DISABLED(DELTA) && defined(SENSORLESS_BACKOFF_MM)
1740
-      const xy_float_t backoff = SENSORLESS_BACKOFF_MM;
1741
-      if ((TERN0(X_SENSORLESS, axis == X_AXIS) || TERN0(Y_SENSORLESS, axis == Y_AXIS)) && backoff[axis]) {
1766
+      const xyz_float_t backoff = SENSORLESS_BACKOFF_MM;
1767
+      if ((TERN0(X_SENSORLESS, axis == X_AXIS) || TERN0(Y_SENSORLESS, axis == Y_AXIS) || TERN0(Z_SENSORLESS, axis == Z_AXIS) || TERN0(I_SENSORLESS, axis == I_AXIS) || TERN0(J_SENSORLESS, axis == J_AXIS) || TERN0(K_SENSORLESS, axis == K_AXIS)) && backoff[axis]) {
1742
         const float backoff_length = -ABS(backoff[axis]) * axis_home_dir;
1768
         const float backoff_length = -ABS(backoff[axis]) * axis_home_dir;
1743
         if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Sensorless backoff: ", backoff_length, "mm");
1769
         if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Sensorless backoff: ", backoff_length, "mm");
1744
         do_homing_move(axis, backoff_length, homing_feedrate(axis));
1770
         do_homing_move(axis, backoff_length, homing_feedrate(axis));
1777
           case X_AXIS: es = X_ENDSTOP; break;
1803
           case X_AXIS: es = X_ENDSTOP; break;
1778
           case Y_AXIS: es = Y_ENDSTOP; break;
1804
           case Y_AXIS: es = Y_ENDSTOP; break;
1779
           case Z_AXIS: es = Z_ENDSTOP; break;
1805
           case Z_AXIS: es = Z_ENDSTOP; break;
1806
+          #if LINEAR_AXES >= 4
1807
+            case I_AXIS: es = I_ENDSTOP; break;
1808
+          #endif
1809
+          #if LINEAR_AXES >= 5
1810
+            case J_AXIS: es = J_ENDSTOP; break;
1811
+          #endif
1812
+          #if LINEAR_AXES >= 6
1813
+            case K_AXIS: es = K_ENDSTOP; break;
1814
+          #endif
1780
         }
1815
         }
1781
         if (TEST(endstops.state(), es)) {
1816
         if (TEST(endstops.state(), es)) {
1782
           SERIAL_ECHO_MSG("Bad ", AS_CHAR(AXIS_CHAR(axis)), " Endstop?");
1817
           SERIAL_ECHO_MSG("Bad ", AS_CHAR(AXIS_CHAR(axis)), " Endstop?");

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

180
               TERN_(MAX_SOFTWARE_ENDSTOP_Z, amax = max.z);
180
               TERN_(MAX_SOFTWARE_ENDSTOP_Z, amax = max.z);
181
               break;
181
               break;
182
           #endif
182
           #endif
183
-          #if LINEAR_AXES >= 4 // TODO (DerAndere): Test for LINEAR_AXES >= 4
183
+          #if LINEAR_AXES >= 4
184
             case I_AXIS:
184
             case I_AXIS:
185
               TERN_(MIN_SOFTWARE_ENDSTOP_I, amin = min.i);
185
               TERN_(MIN_SOFTWARE_ENDSTOP_I, amin = min.i);
186
               TERN_(MIN_SOFTWARE_ENDSTOP_I, amax = max.i);
186
               TERN_(MIN_SOFTWARE_ENDSTOP_I, amax = max.i);

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

1451
     float high = 0.0;
1451
     float high = 0.0;
1452
     for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) {
1452
     for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) {
1453
       block_t *block = &block_buffer[b];
1453
       block_t *block = &block_buffer[b];
1454
-      if (LINEAR_AXIS_GANG(block->steps.x, || block->steps.y, || block->steps.z, block->steps.i, || block->steps.j, || block->steps.k)) {
1454
+      if (LINEAR_AXIS_GANG(block->steps.x, || block->steps.y, || block->steps.z, || block->steps.i, || block->steps.j, || block->steps.k)) {
1455
         const float se = (float)block->steps.e / block->step_event_count * SQRT(block->nominal_speed_sqr); // mm/sec;
1455
         const float se = (float)block->steps.e / block->step_event_count * SQRT(block->nominal_speed_sqr); // mm/sec;
1456
         NOLESS(high, se);
1456
         NOLESS(high, se);
1457
       }
1457
       }
2852
       int32_t(LROUND(abce.a * settings.axis_steps_per_mm[A_AXIS])),
2852
       int32_t(LROUND(abce.a * settings.axis_steps_per_mm[A_AXIS])),
2853
       int32_t(LROUND(abce.b * settings.axis_steps_per_mm[B_AXIS])),
2853
       int32_t(LROUND(abce.b * settings.axis_steps_per_mm[B_AXIS])),
2854
       int32_t(LROUND(abce.c * settings.axis_steps_per_mm[C_AXIS])),
2854
       int32_t(LROUND(abce.c * settings.axis_steps_per_mm[C_AXIS])),
2855
-      int32_t(LROUND(abce.i * settings.axis_steps_per_mm[I_AXIS])), // FIXME (DerAndere): Multiplication by 4.0 is a work-around for issue with wrong internal steps per mm
2855
+      int32_t(LROUND(abce.i * settings.axis_steps_per_mm[I_AXIS])),
2856
       int32_t(LROUND(abce.j * settings.axis_steps_per_mm[J_AXIS])),
2856
       int32_t(LROUND(abce.j * settings.axis_steps_per_mm[J_AXIS])),
2857
       int32_t(LROUND(abce.k * settings.axis_steps_per_mm[K_AXIS]))
2857
       int32_t(LROUND(abce.k * settings.axis_steps_per_mm[K_AXIS]))
2858
     )
2858
     )
2893
     #endif
2893
     #endif
2894
     #if LINEAR_AXES >= 4
2894
     #if LINEAR_AXES >= 4
2895
       SERIAL_ECHOPAIR_P(SP_I_LBL, abce.i);
2895
       SERIAL_ECHOPAIR_P(SP_I_LBL, abce.i);
2896
-      SERIAL_ECHOPAIR(" (", position.i, "->", target.i); // FIXME (DerAndere): Introduce work-around for issue with wrong internal steps per mm and feedrate for I_AXIS
2896
+      SERIAL_ECHOPAIR(" (", position.i, "->", target.i);
2897
       SERIAL_CHAR(')');
2897
       SERIAL_CHAR(')');
2898
     #endif
2898
     #endif
2899
     #if LINEAR_AXES >= 5
2899
     #if LINEAR_AXES >= 5

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

766
     pwmconf.pwm_ofs = 36;
766
     pwmconf.pwm_ofs = 36;
767
     st.PWMCONF(pwmconf.sr);
767
     st.PWMCONF(pwmconf.sr);
768
 
768
 
769
-    #if ENABLED(HYBRID_THRESHOLD)
770
-      st.set_pwm_thrs(hyb_thrs);
771
-    #else
772
-      UNUSED(hyb_thrs);
773
-    #endif
769
+    TERN(HYBRID_THRESHOLD, st.set_pwm_thrs(hyb_thrs), UNUSED(hyb_thrs));
774
     st.GSTAT(); // Clear GSTAT
770
     st.GSTAT(); // Clear GSTAT
775
   }
771
   }
776
 #endif // TMC5160
772
 #endif // TMC5160
971
   // Using a fixed-length character array for the port name allows this to be constexpr compatible.
967
   // Using a fixed-length character array for the port name allows this to be constexpr compatible.
972
   struct SanityHwSerialDetails { const char port[20]; uint32_t address; };
968
   struct SanityHwSerialDetails { const char port[20]; uint32_t address; };
973
   #define TMC_HW_DETAIL_ARGS(A) TERN(A##_HAS_HW_SERIAL, STRINGIFY(A##_HARDWARE_SERIAL), ""), TERN0(A##_HAS_HW_SERIAL, A##_SLAVE_ADDRESS)
969
   #define TMC_HW_DETAIL_ARGS(A) TERN(A##_HAS_HW_SERIAL, STRINGIFY(A##_HARDWARE_SERIAL), ""), TERN0(A##_HAS_HW_SERIAL, A##_SLAVE_ADDRESS)
974
-  #define TMC_HW_DETAIL(A) {TMC_HW_DETAIL_ARGS(A)}
970
+  #define TMC_HW_DETAIL(A) { TMC_HW_DETAIL_ARGS(A) }
975
   constexpr SanityHwSerialDetails sanity_tmc_hw_details[] = {
971
   constexpr SanityHwSerialDetails sanity_tmc_hw_details[] = {
976
     TMC_HW_DETAIL(X), TMC_HW_DETAIL(X2),
972
     TMC_HW_DETAIL(X), TMC_HW_DETAIL(X2),
977
     TMC_HW_DETAIL(Y), TMC_HW_DETAIL(Y2),
973
     TMC_HW_DETAIL(Y), TMC_HW_DETAIL(Y2),
978
     TMC_HW_DETAIL(Z), TMC_HW_DETAIL(Z2), TMC_HW_DETAIL(Z3), TMC_HW_DETAIL(Z4),
974
     TMC_HW_DETAIL(Z), TMC_HW_DETAIL(Z2), TMC_HW_DETAIL(Z3), TMC_HW_DETAIL(Z4),
975
+    TMC_HW_DETAIL(I), TMC_HW_DETAIL(J), TMC_HW_DETAIL(K),
979
     TMC_HW_DETAIL(E0), TMC_HW_DETAIL(E1), TMC_HW_DETAIL(E2), TMC_HW_DETAIL(E3), TMC_HW_DETAIL(E4), TMC_HW_DETAIL(E5), TMC_HW_DETAIL(E6), TMC_HW_DETAIL(E7)
976
     TMC_HW_DETAIL(E0), TMC_HW_DETAIL(E1), TMC_HW_DETAIL(E2), TMC_HW_DETAIL(E3), TMC_HW_DETAIL(E4), TMC_HW_DETAIL(E5), TMC_HW_DETAIL(E6), TMC_HW_DETAIL(E7)
980
   };
977
   };
981
 
978
 
995
 
992
 
996
   #define TMC_HWSERIAL_CONFLICT_MSG(A) STRINGIFY(A) "_SLAVE_ADDRESS conflicts with another driver using the same " STRINGIFY(A) "_HARDWARE_SERIAL"
993
   #define TMC_HWSERIAL_CONFLICT_MSG(A) STRINGIFY(A) "_SLAVE_ADDRESS conflicts with another driver using the same " STRINGIFY(A) "_HARDWARE_SERIAL"
997
   #define SA_NO_TMC_HW_C(A) static_assert(1 >= count_tmc_hw_serial_matches(TMC_HW_DETAIL_ARGS(A), 0, COUNT(sanity_tmc_hw_details)), TMC_HWSERIAL_CONFLICT_MSG(A));
994
   #define SA_NO_TMC_HW_C(A) static_assert(1 >= count_tmc_hw_serial_matches(TMC_HW_DETAIL_ARGS(A), 0, COUNT(sanity_tmc_hw_details)), TMC_HWSERIAL_CONFLICT_MSG(A));
998
-  SA_NO_TMC_HW_C(X);SA_NO_TMC_HW_C(X2);
999
-  SA_NO_TMC_HW_C(Y);SA_NO_TMC_HW_C(Y2);
1000
-  SA_NO_TMC_HW_C(Z);SA_NO_TMC_HW_C(Z2);SA_NO_TMC_HW_C(Z3);SA_NO_TMC_HW_C(Z4);
1001
-  SA_NO_TMC_HW_C(E0);SA_NO_TMC_HW_C(E1);SA_NO_TMC_HW_C(E2);SA_NO_TMC_HW_C(E3);SA_NO_TMC_HW_C(E4);SA_NO_TMC_HW_C(E5);SA_NO_TMC_HW_C(E6);SA_NO_TMC_HW_C(E7);
995
+  SA_NO_TMC_HW_C(X); SA_NO_TMC_HW_C(X2);
996
+  SA_NO_TMC_HW_C(Y); SA_NO_TMC_HW_C(Y2);
997
+  SA_NO_TMC_HW_C(Z); SA_NO_TMC_HW_C(Z2); SA_NO_TMC_HW_C(Z3); SA_NO_TMC_HW_C(Z4);
998
+  SA_NO_TMC_HW_C(I); SA_NO_TMC_HW_C(J); SA_NO_TMC_HW_C(K);
999
+  SA_NO_TMC_HW_C(E0); SA_NO_TMC_HW_C(E1); SA_NO_TMC_HW_C(E2); SA_NO_TMC_HW_C(E3); SA_NO_TMC_HW_C(E4); SA_NO_TMC_HW_C(E5); SA_NO_TMC_HW_C(E6); SA_NO_TMC_HW_C(E7);
1002
 #endif
1000
 #endif
1003
 
1001
 
1004
 #if ANY_AXIS_HAS(SW_SERIAL)
1002
 #if ANY_AXIS_HAS(SW_SERIAL)
1009
     TMC_SW_DETAIL(X), TMC_SW_DETAIL(X2),
1007
     TMC_SW_DETAIL(X), TMC_SW_DETAIL(X2),
1010
     TMC_SW_DETAIL(Y), TMC_SW_DETAIL(Y2),
1008
     TMC_SW_DETAIL(Y), TMC_SW_DETAIL(Y2),
1011
     TMC_SW_DETAIL(Z), TMC_SW_DETAIL(Z2), TMC_SW_DETAIL(Z3), TMC_SW_DETAIL(Z4),
1009
     TMC_SW_DETAIL(Z), TMC_SW_DETAIL(Z2), TMC_SW_DETAIL(Z3), TMC_SW_DETAIL(Z4),
1012
-    TMC_SW_DETAIL(E0), TMC_SW_DETAIL(E1), TMC_SW_DETAIL(E2), TMC_SW_DETAIL(E3), TMC_SW_DETAIL(E4), TMC_SW_DETAIL(E5), TMC_SW_DETAIL(E6), TMC_SW_DETAIL(E7)
1010
+    TMC_SW_DETAIL(I), TMC_SW_DETAIL(J), TMC_SW_DETAIL(K),
1011
+  	TMC_SW_DETAIL(E0), TMC_SW_DETAIL(E1), TMC_SW_DETAIL(E2), TMC_SW_DETAIL(E3), TMC_SW_DETAIL(E4), TMC_SW_DETAIL(E5), TMC_SW_DETAIL(E6), TMC_SW_DETAIL(E7)
1013
   };
1012
   };
1014
 
1013
 
1015
   constexpr bool sc_sw_done(size_t start, size_t end) { return start == end; }
1014
   constexpr bool sc_sw_done(size_t start, size_t end) { return start == end; }
1023
 
1022
 
1024
   #define TMC_SWSERIAL_CONFLICT_MSG(A) STRINGIFY(A) "_SLAVE_ADDRESS conflicts with another driver using the same " STRINGIFY(A) "_SERIAL_RX_PIN or " STRINGIFY(A) "_SERIAL_TX_PIN"
1023
   #define TMC_SWSERIAL_CONFLICT_MSG(A) STRINGIFY(A) "_SLAVE_ADDRESS conflicts with another driver using the same " STRINGIFY(A) "_SERIAL_RX_PIN or " STRINGIFY(A) "_SERIAL_TX_PIN"
1025
   #define SA_NO_TMC_SW_C(A) static_assert(1 >= count_tmc_sw_serial_matches(TMC_SW_DETAIL_ARGS(A), 0, COUNT(sanity_tmc_sw_details)), TMC_SWSERIAL_CONFLICT_MSG(A));
1024
   #define SA_NO_TMC_SW_C(A) static_assert(1 >= count_tmc_sw_serial_matches(TMC_SW_DETAIL_ARGS(A), 0, COUNT(sanity_tmc_sw_details)), TMC_SWSERIAL_CONFLICT_MSG(A));
1026
-  SA_NO_TMC_SW_C(X);SA_NO_TMC_SW_C(X2);
1027
-  SA_NO_TMC_SW_C(Y);SA_NO_TMC_SW_C(Y2);
1028
-  SA_NO_TMC_SW_C(Z);SA_NO_TMC_SW_C(Z2);SA_NO_TMC_SW_C(Z3);SA_NO_TMC_SW_C(Z4);
1029
-  SA_NO_TMC_SW_C(E0);SA_NO_TMC_SW_C(E1);SA_NO_TMC_SW_C(E2);SA_NO_TMC_SW_C(E3);SA_NO_TMC_SW_C(E4);SA_NO_TMC_SW_C(E5);SA_NO_TMC_SW_C(E6);SA_NO_TMC_SW_C(E7);
1025
+  SA_NO_TMC_SW_C(X); SA_NO_TMC_SW_C(X2);
1026
+  SA_NO_TMC_SW_C(Y); SA_NO_TMC_SW_C(Y2);
1027
+  SA_NO_TMC_SW_C(Z); SA_NO_TMC_SW_C(Z2); SA_NO_TMC_SW_C(Z3); SA_NO_TMC_SW_C(Z4);
1028
+  SA_NO_TMC_SW_C(I); SA_NO_TMC_SW_C(J); SA_NO_TMC_SW_C(K);
1029
+  SA_NO_TMC_SW_C(E0); SA_NO_TMC_SW_C(E1); SA_NO_TMC_SW_C(E2); SA_NO_TMC_SW_C(E3); SA_NO_TMC_SW_C(E4); SA_NO_TMC_SW_C(E5); SA_NO_TMC_SW_C(E6); SA_NO_TMC_SW_C(E7);
1030
 #endif
1030
 #endif
1031
 
1031
 
1032
 #endif // HAS_TRINAMIC_CONFIG
1032
 #endif // HAS_TRINAMIC_CONFIG

+ 42
- 25
Marlin/src/pins/pins_postprocess.h View File

212
 #if !AXIS_HAS_SPI(Z)
212
 #if !AXIS_HAS_SPI(Z)
213
   #undef Z_CS_PIN
213
   #undef Z_CS_PIN
214
 #endif
214
 #endif
215
+#if !AXIS_HAS_SPI(I)
216
+  #undef I_CS_PIN
217
+#endif
218
+#if !AXIS_HAS_SPI(J)
219
+  #undef J_CS_PIN
220
+#endif
221
+#if !AXIS_HAS_SPI(K)
222
+  #undef K_CS_PIN
223
+#endif
215
 #if E_STEPPERS && !AXIS_HAS_SPI(E0)
224
 #if E_STEPPERS && !AXIS_HAS_SPI(E0)
216
   #undef E0_CS_PIN
225
   #undef E0_CS_PIN
217
 #endif
226
 #endif
246
 #ifndef Z_CS_PIN
255
 #ifndef Z_CS_PIN
247
   #define Z_CS_PIN -1
256
   #define Z_CS_PIN -1
248
 #endif
257
 #endif
258
+#ifndef I_CS_PIN
259
+  #define I_CS_PIN -1
260
+#endif
261
+#ifndef J_CS_PIN
262
+  #define J_CS_PIN -1
263
+#endif
264
+#ifndef K_CS_PIN
265
+  #define K_CS_PIN -1
266
+#endif
249
 #ifndef E0_CS_PIN
267
 #ifndef E0_CS_PIN
250
   #define E0_CS_PIN -1
268
   #define E0_CS_PIN -1
251
 #endif
269
 #endif
900
   #undef Z_MIN_PROBE_PIN
918
   #undef Z_MIN_PROBE_PIN
901
   #define Z_MIN_PROBE_PIN    -1
919
   #define Z_MIN_PROBE_PIN    -1
902
 #endif
920
 #endif
921
+#if DISABLED(USE_XMIN_PLUG)
922
+  #undef X_MIN_PIN
923
+  #define X_MIN_PIN          -1
924
+#endif
903
 #if DISABLED(USE_XMAX_PLUG)
925
 #if DISABLED(USE_XMAX_PLUG)
904
   #undef X_MAX_PIN
926
   #undef X_MAX_PIN
905
   #define X_MAX_PIN          -1
927
   #define X_MAX_PIN          -1
906
 #endif
928
 #endif
929
+#if DISABLED(USE_YMIN_PLUG)
930
+  #undef Y_MIN_PIN
931
+  #define Y_MIN_PIN          -1
932
+#endif
907
 #if DISABLED(USE_YMAX_PLUG)
933
 #if DISABLED(USE_YMAX_PLUG)
908
   #undef Y_MAX_PIN
934
   #undef Y_MAX_PIN
909
   #define Y_MAX_PIN          -1
935
   #define Y_MAX_PIN          -1
910
 #endif
936
 #endif
937
+#if DISABLED(USE_ZMIN_PLUG)
938
+  #undef Z_MIN_PIN
939
+  #define Z_MIN_PIN          -1
940
+#endif
911
 #if DISABLED(USE_ZMAX_PLUG)
941
 #if DISABLED(USE_ZMAX_PLUG)
912
   #undef Z_MAX_PIN
942
   #undef Z_MAX_PIN
913
   #define Z_MAX_PIN          -1
943
   #define Z_MAX_PIN          -1
914
 #endif
944
 #endif
945
+#if DISABLED(USE_IMIN_PLUG)
946
+  #undef I_MIN_PIN
947
+  #define I_MIN_PIN          -1
948
+#endif
915
 #if DISABLED(USE_IMAX_PLUG)
949
 #if DISABLED(USE_IMAX_PLUG)
916
   #undef I_MAX_PIN
950
   #undef I_MAX_PIN
917
   #define I_MAX_PIN          -1
951
   #define I_MAX_PIN          -1
918
 #endif
952
 #endif
953
+#if DISABLED(USE_JMIN_PLUG)
954
+  #undef J_MIN_PIN
955
+  #define J_MIN_PIN          -1
956
+#endif
919
 #if DISABLED(USE_JMAX_PLUG)
957
 #if DISABLED(USE_JMAX_PLUG)
920
   #undef J_MAX_PIN
958
   #undef J_MAX_PIN
921
   #define J_MAX_PIN          -1
959
   #define J_MAX_PIN          -1
922
 #endif
960
 #endif
961
+#if DISABLED(USE_KMIN_PLUG)
962
+  #undef K_MIN_PIN
963
+  #define K_MIN_PIN          -1
964
+#endif
923
 #if DISABLED(USE_KMAX_PLUG)
965
 #if DISABLED(USE_KMAX_PLUG)
924
   #undef K_MAX_PIN
966
   #undef K_MAX_PIN
925
   #define K_MAX_PIN          -1
967
   #define K_MAX_PIN          -1
926
 #endif
968
 #endif
927
 
969
 
928
-#if DISABLED(USE_XMIN_PLUG)
929
-  #undef X_MIN_PIN
930
-  #define X_MIN_PIN          -1
931
-#endif
932
-#if DISABLED(USE_YMIN_PLUG)
933
-  #undef Y_MIN_PIN
934
-  #define Y_MIN_PIN          -1
935
-#endif
936
-#if DISABLED(USE_ZMIN_PLUG)
937
-  #undef Z_MIN_PIN
938
-  #define Z_MIN_PIN          -1
939
-#endif
940
 #if DISABLED(X_DUAL_ENDSTOPS) || X_HOME_TO_MAX
970
 #if DISABLED(X_DUAL_ENDSTOPS) || X_HOME_TO_MAX
941
   #undef X2_MIN_PIN
971
   #undef X2_MIN_PIN
942
 #endif
972
 #endif
968
   #undef Z4_MAX_PIN
998
   #undef Z4_MAX_PIN
969
 #endif
999
 #endif
970
 
1000
 
971
-#if DISABLED(USE_IMIN_PLUG)
972
-  #undef I_MIN_PIN
973
-  #define I_MIN_PIN          -1
974
-#endif
975
-#if DISABLED(USE_JMIN_PLUG)
976
-  #undef J_MIN_PIN
977
-  #define J_MIN_PIN          -1
978
-#endif
979
-#if DISABLED(USE_KMIN_PLUG)
980
-  #undef K_MIN_PIN
981
-  #define K_MIN_PIN          -1
982
-#endif
983
-
984
 //
1001
 //
985
 // Default DOGLCD SPI delays
1002
 // Default DOGLCD SPI delays
986
 //
1003
 //

+ 3
- 3
Marlin/src/pins/sensitive_pins.h View File

167
   #else
167
   #else
168
     #define _I_MAX
168
     #define _I_MAX
169
   #endif
169
   #endif
170
-  #if PIN_EXISTS(I_CS)
170
+  #if PIN_EXISTS(I_CS) && AXIS_HAS_SPI(I)
171
     #define _I_CS I_CS_PIN,
171
     #define _I_CS I_CS_PIN,
172
   #else
172
   #else
173
     #define _I_CS
173
     #define _I_CS
208
   #else
208
   #else
209
     #define _J_MAX
209
     #define _J_MAX
210
   #endif
210
   #endif
211
-  #if PIN_EXISTS(J_CS)
211
+  #if PIN_EXISTS(J_CS) && AXIS_HAS_SPI(J)
212
     #define _J_CS J_CS_PIN,
212
     #define _J_CS J_CS_PIN,
213
   #else
213
   #else
214
     #define _J_CS
214
     #define _J_CS
249
   #else
249
   #else
250
     #define _K_MAX
250
     #define _K_MAX
251
   #endif
251
   #endif
252
-  #if PIN_EXISTS(K_CS)
252
+  #if PIN_EXISTS(K_CS) && AXIS_HAS_SPI(K)
253
     #define _K_CS K_CS_PIN,
253
     #define _K_CS K_CS_PIN,
254
   #else
254
   #else
255
     #define _K_CS
255
     #define _K_CS

Loading…
Cancel
Save