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,7 +734,7 @@
734 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 739
 #define HOMING_BUMP_MM      { 5, 5, 2 }       // (mm) Backoff from endstops after first bump
740 740
 #define HOMING_BUMP_DIVISOR { 2, 2, 4 }       // Re-Bump Speed Divisor (Divides the Homing Feedrate)
@@ -2253,7 +2253,7 @@
2253 2253
    * Extra G-code to run while executing tool-change commands. Can be used to use an additional
2254 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 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,15 +36,15 @@
36 36
 #define _XMIN_   100
37 37
 #define _YMIN_   200
38 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 42
 #define _XMAX_   101
43 43
 #define _YMAX_   201
44 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 48
 #define _XDIAG_  102
49 49
 #define _YDIAG_  202
50 50
 #define _ZDIAG_  302

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

@@ -570,8 +570,8 @@
570 570
   #error "NEOPIXEL_BKGD_LED_INDEX is now NEOPIXEL_BKGD_INDEX_FIRST."
571 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 577
  * Probe temp compensation requirements

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

@@ -223,7 +223,7 @@ class Endstops {
223 223
       typedef struct {
224 224
         union {
225 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 228
       } tmc_spi_homing_t;
229 229
       static tmc_spi_homing_t tmc_spi_homing;

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

@@ -588,27 +588,27 @@ void do_blocking_move_to_x(const_float_t rx, const_feedRate_t fr_mm_s/*=0.0*/) {
588 588
   }
589 589
 #endif
590 590
 
591
-#if LINEAR_AXES == 4
591
+#if LINEAR_AXES >= 4
592 592
   void do_blocking_move_to_i(const_float_t ri, const_feedRate_t fr_mm_s/*=0.0*/) {
593 593
     do_blocking_move_to_xyz_i(current_position, ri, fr_mm_s);
594 594
   }
595 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 601
 #endif
599 602
 
600 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 604
   void do_blocking_move_to_j(const_float_t rj, const_feedRate_t fr_mm_s/*=0.0*/) {
608 605
     do_blocking_move_to_xyzi_j(current_position, rj, fr_mm_s);
609 606
   }
610 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 613
 #endif
614 614
 
@@ -617,7 +617,10 @@ void do_blocking_move_to_x(const_float_t rx, const_feedRate_t fr_mm_s/*=0.0*/) {
617 617
     do_blocking_move_to_xyzij_k(current_position, rk, fr_mm_s);
618 618
   }
619 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 625
 #endif
623 626
 
@@ -822,7 +825,7 @@ void restore_feedrate_and_scaling() {
822 825
         #endif
823 826
       }
824 827
     #endif
825
-    #if LINEAR_AXES >= 4  // TODO (DerAndere): Find out why this was missing / removed
828
+    #if LINEAR_AXES >= 4
826 829
       if (axis_was_homed(I_AXIS)) {
827 830
         #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_I)
828 831
           NOLESS(target.i, soft_endstop.min.i);
@@ -1295,7 +1298,7 @@ void prepare_line_to_destination() {
1295 1298
 
1296 1299
   bool homing_needed_error(linear_axis_bits_t axis_bits/*=linear_bits*/) {
1297 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 1302
       char msg[strlen_P(home_first)+1];
1300 1303
       sprintf_P(msg, home_first,
1301 1304
         LINEAR_AXIS_LIST(
@@ -1390,8 +1393,21 @@ void prepare_line_to_destination() {
1390 1393
       #if ENABLED(SPI_ENDSTOPS)
1391 1394
         switch (axis) {
1392 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 1411
           default: break;
1396 1412
         }
1397 1413
       #endif
@@ -1454,11 +1470,21 @@ void prepare_line_to_destination() {
1454 1470
       #if ENABLED(SPI_ENDSTOPS)
1455 1471
         switch (axis) {
1456 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 1488
           default: break;
1463 1489
         }
1464 1490
       #endif
@@ -1734,11 +1760,11 @@ void prepare_line_to_destination() {
1734 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 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 1768
         const float backoff_length = -ABS(backoff[axis]) * axis_home_dir;
1743 1769
         if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Sensorless backoff: ", backoff_length, "mm");
1744 1770
         do_homing_move(axis, backoff_length, homing_feedrate(axis));
@@ -1777,6 +1803,15 @@ void prepare_line_to_destination() {
1777 1803
           case X_AXIS: es = X_ENDSTOP; break;
1778 1804
           case Y_AXIS: es = Y_ENDSTOP; break;
1779 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 1816
         if (TEST(endstops.state(), es)) {
1782 1817
           SERIAL_ECHO_MSG("Bad ", AS_CHAR(AXIS_CHAR(axis)), " Endstop?");

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

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

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

@@ -1451,7 +1451,7 @@ void Planner::check_axes_activity() {
1451 1451
     float high = 0.0;
1452 1452
     for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) {
1453 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 1455
         const float se = (float)block->steps.e / block->step_event_count * SQRT(block->nominal_speed_sqr); // mm/sec;
1456 1456
         NOLESS(high, se);
1457 1457
       }
@@ -2852,7 +2852,7 @@ bool Planner::buffer_segment(const abce_pos_t &abce
2852 2852
       int32_t(LROUND(abce.a * settings.axis_steps_per_mm[A_AXIS])),
2853 2853
       int32_t(LROUND(abce.b * settings.axis_steps_per_mm[B_AXIS])),
2854 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 2856
       int32_t(LROUND(abce.j * settings.axis_steps_per_mm[J_AXIS])),
2857 2857
       int32_t(LROUND(abce.k * settings.axis_steps_per_mm[K_AXIS]))
2858 2858
     )
@@ -2893,7 +2893,7 @@ bool Planner::buffer_segment(const abce_pos_t &abce
2893 2893
     #endif
2894 2894
     #if LINEAR_AXES >= 4
2895 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 2897
       SERIAL_CHAR(')');
2898 2898
     #endif
2899 2899
     #if LINEAR_AXES >= 5

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

@@ -766,11 +766,7 @@ enum StealthIndex : uint8_t {
766 766
     pwmconf.pwm_ofs = 36;
767 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 770
     st.GSTAT(); // Clear GSTAT
775 771
   }
776 772
 #endif // TMC5160
@@ -971,11 +967,12 @@ void reset_trinamic_drivers() {
971 967
   // Using a fixed-length character array for the port name allows this to be constexpr compatible.
972 968
   struct SanityHwSerialDetails { const char port[20]; uint32_t address; };
973 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 971
   constexpr SanityHwSerialDetails sanity_tmc_hw_details[] = {
976 972
     TMC_HW_DETAIL(X), TMC_HW_DETAIL(X2),
977 973
     TMC_HW_DETAIL(Y), TMC_HW_DETAIL(Y2),
978 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 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,10 +992,11 @@ void reset_trinamic_drivers() {
995 992
 
996 993
   #define TMC_HWSERIAL_CONFLICT_MSG(A) STRINGIFY(A) "_SLAVE_ADDRESS conflicts with another driver using the same " STRINGIFY(A) "_HARDWARE_SERIAL"
997 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 1000
 #endif
1003 1001
 
1004 1002
 #if ANY_AXIS_HAS(SW_SERIAL)
@@ -1009,7 +1007,8 @@ void reset_trinamic_drivers() {
1009 1007
     TMC_SW_DETAIL(X), TMC_SW_DETAIL(X2),
1010 1008
     TMC_SW_DETAIL(Y), TMC_SW_DETAIL(Y2),
1011 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 1014
   constexpr bool sc_sw_done(size_t start, size_t end) { return start == end; }
@@ -1023,10 +1022,11 @@ void reset_trinamic_drivers() {
1023 1022
 
1024 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 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 1030
 #endif
1031 1031
 
1032 1032
 #endif // HAS_TRINAMIC_CONFIG

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

@@ -212,6 +212,15 @@
212 212
 #if !AXIS_HAS_SPI(Z)
213 213
   #undef Z_CS_PIN
214 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 224
 #if E_STEPPERS && !AXIS_HAS_SPI(E0)
216 225
   #undef E0_CS_PIN
217 226
 #endif
@@ -246,6 +255,15 @@
246 255
 #ifndef Z_CS_PIN
247 256
   #define Z_CS_PIN -1
248 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 267
 #ifndef E0_CS_PIN
250 268
   #define E0_CS_PIN -1
251 269
 #endif
@@ -900,43 +918,55 @@
900 918
   #undef Z_MIN_PROBE_PIN
901 919
   #define Z_MIN_PROBE_PIN    -1
902 920
 #endif
921
+#if DISABLED(USE_XMIN_PLUG)
922
+  #undef X_MIN_PIN
923
+  #define X_MIN_PIN          -1
924
+#endif
903 925
 #if DISABLED(USE_XMAX_PLUG)
904 926
   #undef X_MAX_PIN
905 927
   #define X_MAX_PIN          -1
906 928
 #endif
929
+#if DISABLED(USE_YMIN_PLUG)
930
+  #undef Y_MIN_PIN
931
+  #define Y_MIN_PIN          -1
932
+#endif
907 933
 #if DISABLED(USE_YMAX_PLUG)
908 934
   #undef Y_MAX_PIN
909 935
   #define Y_MAX_PIN          -1
910 936
 #endif
937
+#if DISABLED(USE_ZMIN_PLUG)
938
+  #undef Z_MIN_PIN
939
+  #define Z_MIN_PIN          -1
940
+#endif
911 941
 #if DISABLED(USE_ZMAX_PLUG)
912 942
   #undef Z_MAX_PIN
913 943
   #define Z_MAX_PIN          -1
914 944
 #endif
945
+#if DISABLED(USE_IMIN_PLUG)
946
+  #undef I_MIN_PIN
947
+  #define I_MIN_PIN          -1
948
+#endif
915 949
 #if DISABLED(USE_IMAX_PLUG)
916 950
   #undef I_MAX_PIN
917 951
   #define I_MAX_PIN          -1
918 952
 #endif
953
+#if DISABLED(USE_JMIN_PLUG)
954
+  #undef J_MIN_PIN
955
+  #define J_MIN_PIN          -1
956
+#endif
919 957
 #if DISABLED(USE_JMAX_PLUG)
920 958
   #undef J_MAX_PIN
921 959
   #define J_MAX_PIN          -1
922 960
 #endif
961
+#if DISABLED(USE_KMIN_PLUG)
962
+  #undef K_MIN_PIN
963
+  #define K_MIN_PIN          -1
964
+#endif
923 965
 #if DISABLED(USE_KMAX_PLUG)
924 966
   #undef K_MAX_PIN
925 967
   #define K_MAX_PIN          -1
926 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 970
 #if DISABLED(X_DUAL_ENDSTOPS) || X_HOME_TO_MAX
941 971
   #undef X2_MIN_PIN
942 972
 #endif
@@ -968,19 +998,6 @@
968 998
   #undef Z4_MAX_PIN
969 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 1002
 // Default DOGLCD SPI delays
986 1003
 //

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

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

Loading…
Cancel
Save