Преглед на файлове

🎨 Fix L64xx enable, clean up conditionals

Scott Lahteine преди 3 години
родител
ревизия
b88117d636

+ 1
- 1
Marlin/src/feature/pause.cpp Целия файл

@@ -207,7 +207,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
207 207
         #if ENABLED(MULTI_FILAMENT_SENSOR)
208 208
           #define _CASE_INSERTED(N) case N-1: if (READ(FIL_RUNOUT##N##_PIN) != FIL_RUNOUT##N##_STATE) wait_for_user = false; break;
209 209
           switch (active_extruder) {
210
-            REPEAT_S(1, INCREMENT(NUM_RUNOUT_SENSORS), _CASE_INSERTED)
210
+            REPEAT_1(NUM_RUNOUT_SENSORS, _CASE_INSERTED)
211 211
           }
212 212
         #else
213 213
           if (READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_STATE) wait_for_user = false;

+ 2
- 2
Marlin/src/gcode/feature/leds/M150.cpp Целия файл

@@ -56,10 +56,10 @@ void GcodeSuite::M150() {
56 56
   #if ENABLED(NEOPIXEL_LED)
57 57
     const int8_t index = parser.intval('I', -1);
58 58
     #if ENABLED(NEOPIXEL2_SEPARATE)
59
-      int8_t brightness, unit = parser.intval('S', -1);
59
+      int8_t brightness = neo.brightness(), unit = parser.intval('S', -1);
60 60
       switch (unit) {
61 61
         case -1: neo2.neoindex = index; // fall-thru
62
-        case  0:  neo.neoindex = index; brightness =  neo.brightness(); break;
62
+        case  0:  neo.neoindex = index; break;
63 63
         case  1: neo2.neoindex = index; brightness = neo2.brightness(); break;
64 64
       }
65 65
     #else

+ 162
- 145
Marlin/src/inc/Conditionals_post.h Целия файл

@@ -94,6 +94,8 @@
94 94
 #endif
95 95
 #if HAS_Z_AXIS
96 96
   #define Z_MAX_LENGTH (Z_MAX_POS - (Z_MIN_POS))
97
+#else
98
+  #undef CONTROLLER_FAN_USE_Z_ONLY
97 99
 #endif
98 100
 #if LINEAR_AXES >= 4
99 101
   #define I_MAX_LENGTH (I_MAX_POS - (I_MIN_POS))
@@ -471,31 +473,6 @@
471 473
 #endif
472 474
 
473 475
 /**
474
- * Set defaults for missing (newer) options
475
- */
476
-#ifndef DISABLE_INACTIVE_X
477
-  #define DISABLE_INACTIVE_X DISABLE_X
478
-#endif
479
-#if HAS_Y_AXIS && !defined(DISABLE_INACTIVE_Y)
480
-  #define DISABLE_INACTIVE_Y DISABLE_Y
481
-#endif
482
-#if HAS_Z_AXIS && !defined(DISABLE_INACTIVE_Z)
483
-  #define DISABLE_INACTIVE_Z DISABLE_Z
484
-#endif
485
-#ifndef DISABLE_INACTIVE_E
486
-  #define DISABLE_INACTIVE_E DISABLE_E
487
-#endif
488
-#if LINEAR_AXES >= 4 && !defined(DISABLE_INACTIVE_I)
489
-  #define DISABLE_INACTIVE_I DISABLE_I
490
-#endif
491
-#if LINEAR_AXES >= 5 && !defined(DISABLE_INACTIVE_J)
492
-  #define DISABLE_INACTIVE_J DISABLE_J
493
-#endif
494
-#if LINEAR_AXES >= 6 && !defined(DISABLE_INACTIVE_K)
495
-  #define DISABLE_INACTIVE_K DISABLE_K
496
-#endif
497
-
498
-/**
499 476
  * Power Supply
500 477
  */
501 478
 #ifndef PSU_NAME
@@ -1468,7 +1445,7 @@
1468 1445
   #define HAS_X_MS_PINS 1
1469 1446
 #endif
1470 1447
 
1471
-#if PIN_EXISTS(X2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X2))
1448
+#if PIN_EXISTS(X2_ENABLE) || AXIS_IS_L64XX(X2) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X2))
1472 1449
   #define HAS_X2_ENABLE 1
1473 1450
 #endif
1474 1451
 #if PIN_EXISTS(X2_DIR)
@@ -1481,8 +1458,15 @@
1481 1458
   #define HAS_X2_MS_PINS 1
1482 1459
 #endif
1483 1460
 
1461
+/**
1462
+ * Set defaults for missing (newer) options
1463
+ */
1464
+#if !defined(DISABLE_INACTIVE_X) && ENABLED(DISABLE_X)
1465
+  #define DISABLE_INACTIVE_X 1
1466
+#endif
1467
+
1484 1468
 #if HAS_Y_AXIS
1485
-  #if PIN_EXISTS(Y_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y))
1469
+  #if PIN_EXISTS(Y_ENABLE) || AXIS_IS_L64XX(Y) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y))
1486 1470
     #define HAS_Y_ENABLE 1
1487 1471
   #endif
1488 1472
   #if PIN_EXISTS(Y_DIR)
@@ -1495,7 +1479,7 @@
1495 1479
     #define HAS_Y_MS_PINS 1
1496 1480
   #endif
1497 1481
 
1498
-  #if PIN_EXISTS(Y2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y2))
1482
+  #if PIN_EXISTS(Y2_ENABLE) || AXIS_IS_L64XX(Y2) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y2))
1499 1483
     #define HAS_Y2_ENABLE 1
1500 1484
   #endif
1501 1485
   #if PIN_EXISTS(Y2_DIR)
@@ -1507,10 +1491,15 @@
1507 1491
   #if PIN_EXISTS(Y2_MS1)
1508 1492
     #define HAS_Y2_MS_PINS 1
1509 1493
   #endif
1494
+  #if !defined(DISABLE_INACTIVE_Y) && ENABLED(DISABLE_Y)
1495
+    #define DISABLE_INACTIVE_Y 1
1496
+  #endif
1497
+#else
1498
+  #undef DISABLE_INACTIVE_Y
1510 1499
 #endif
1511 1500
 
1512 1501
 #if HAS_Z_AXIS
1513
-  #if PIN_EXISTS(Z_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z))
1502
+  #if PIN_EXISTS(Z_ENABLE) || AXIS_IS_L64XX(Z) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z))
1514 1503
     #define HAS_Z_ENABLE 1
1515 1504
   #endif
1516 1505
   #if PIN_EXISTS(Z_DIR)
@@ -1522,10 +1511,15 @@
1522 1511
   #if PIN_EXISTS(Z_MS1)
1523 1512
     #define HAS_Z_MS_PINS 1
1524 1513
   #endif
1514
+  #if !defined(DISABLE_INACTIVE_Z) && ENABLED(DISABLE_Z)
1515
+    #define DISABLE_INACTIVE_Z 1
1516
+  #endif
1517
+#else
1518
+  #undef DISABLE_INACTIVE_Z
1525 1519
 #endif
1526 1520
 
1527 1521
 #if NUM_Z_STEPPER_DRIVERS >= 2
1528
-  #if PIN_EXISTS(Z2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2))
1522
+  #if PIN_EXISTS(Z2_ENABLE) || AXIS_IS_L64XX(Z2) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2))
1529 1523
     #define HAS_Z2_ENABLE 1
1530 1524
   #endif
1531 1525
   #if PIN_EXISTS(Z2_DIR)
@@ -1540,7 +1534,7 @@
1540 1534
 #endif
1541 1535
 
1542 1536
 #if NUM_Z_STEPPER_DRIVERS >= 3
1543
-  #if PIN_EXISTS(Z3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z3))
1537
+  #if PIN_EXISTS(Z3_ENABLE) || AXIS_IS_L64XX(Z3) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z3))
1544 1538
     #define HAS_Z3_ENABLE 1
1545 1539
   #endif
1546 1540
   #if PIN_EXISTS(Z3_DIR)
@@ -1555,7 +1549,7 @@
1555 1549
 #endif
1556 1550
 
1557 1551
 #if NUM_Z_STEPPER_DRIVERS >= 4
1558
-  #if PIN_EXISTS(Z4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z4))
1552
+  #if PIN_EXISTS(Z4_ENABLE) || AXIS_IS_L64XX(Z4) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z4))
1559 1553
     #define HAS_Z4_ENABLE 1
1560 1554
   #endif
1561 1555
   #if PIN_EXISTS(Z4_DIR)
@@ -1570,7 +1564,7 @@
1570 1564
 #endif
1571 1565
 
1572 1566
 #if LINEAR_AXES >= 4
1573
-  #if PIN_EXISTS(I_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(I))
1567
+  #if PIN_EXISTS(I_ENABLE) || AXIS_IS_L64XX(I) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(I))
1574 1568
     #define HAS_I_ENABLE 1
1575 1569
   #endif
1576 1570
   #if PIN_EXISTS(I_DIR)
@@ -1582,10 +1576,15 @@
1582 1576
   #if PIN_EXISTS(I_MS1)
1583 1577
     #define HAS_I_MS_PINS 1
1584 1578
   #endif
1579
+  #if !defined(DISABLE_INACTIVE_I) && ENABLED(DISABLE_I)
1580
+    #define DISABLE_INACTIVE_I 1
1581
+  #endif
1582
+#else
1583
+  #undef DISABLE_INACTIVE_I
1585 1584
 #endif
1586 1585
 
1587 1586
 #if LINEAR_AXES >= 5
1588
-  #if PIN_EXISTS(J_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(J))
1587
+  #if PIN_EXISTS(J_ENABLE) || AXIS_IS_L64XX(J) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(J))
1589 1588
     #define HAS_J_ENABLE 1
1590 1589
   #endif
1591 1590
   #if PIN_EXISTS(J_DIR)
@@ -1597,10 +1596,15 @@
1597 1596
   #if PIN_EXISTS(J_MS1)
1598 1597
     #define HAS_J_MS_PINS 1
1599 1598
   #endif
1599
+  #if !defined(DISABLE_INACTIVE_J) && ENABLED(DISABLE_J)
1600
+    #define DISABLE_INACTIVE_J 1
1601
+  #endif
1602
+#else
1603
+  #undef DISABLE_INACTIVE_J
1600 1604
 #endif
1601 1605
 
1602 1606
 #if LINEAR_AXES >= 6
1603
-  #if PIN_EXISTS(K_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(K))
1607
+  #if PIN_EXISTS(K_ENABLE) || AXIS_IS_L64XX(K) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(K))
1604 1608
     #define HAS_K_ENABLE 1
1605 1609
   #endif
1606 1610
   #if PIN_EXISTS(K_DIR)
@@ -1612,12 +1616,17 @@
1612 1616
   #if PIN_EXISTS(K_MS1)
1613 1617
     #define HAS_K_MS_PINS 1
1614 1618
   #endif
1619
+  #if !defined(DISABLE_INACTIVE_K) && ENABLED(DISABLE_K)
1620
+    #define DISABLE_INACTIVE_K 1
1621
+  #endif
1622
+#else
1623
+  #undef DISABLE_INACTIVE_K
1615 1624
 #endif
1616 1625
 
1617 1626
 // Extruder steppers and solenoids
1618 1627
 #if HAS_EXTRUDERS
1619 1628
 
1620
-  #if PIN_EXISTS(E0_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0))
1629
+  #if PIN_EXISTS(E0_ENABLE) || AXIS_IS_L64XX(E0) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0))
1621 1630
     #define HAS_E0_ENABLE 1
1622 1631
   #endif
1623 1632
   #if PIN_EXISTS(E0_DIR)
@@ -1633,118 +1642,137 @@
1633 1642
     #define HAS_SOLENOID_0 1
1634 1643
   #endif
1635 1644
 
1636
-  #if PIN_EXISTS(E1_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1))
1637
-    #define HAS_E1_ENABLE 1
1638
-  #endif
1639
-  #if PIN_EXISTS(E1_DIR)
1640
-    #define HAS_E1_DIR 1
1641
-  #endif
1642
-  #if PIN_EXISTS(E1_STEP)
1643
-    #define HAS_E1_STEP 1
1644
-  #endif
1645
-  #if PIN_EXISTS(E1_MS1)
1646
-    #define HAS_E1_MS_PINS 1
1647
-  #endif
1648
-  #if PIN_EXISTS(SOL1)
1649
-    #define HAS_SOLENOID_1 1
1645
+  #if E_STEPPERS > 1
1646
+    #if PIN_EXISTS(E1_ENABLE) || AXIS_IS_L64XX(E1) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1))
1647
+      #define HAS_E1_ENABLE 1
1648
+    #endif
1649
+    #if PIN_EXISTS(E1_DIR)
1650
+      #define HAS_E1_DIR 1
1651
+    #endif
1652
+    #if PIN_EXISTS(E1_STEP)
1653
+      #define HAS_E1_STEP 1
1654
+    #endif
1655
+    #if PIN_EXISTS(E1_MS1)
1656
+      #define HAS_E1_MS_PINS 1
1657
+    #endif
1658
+    #if PIN_EXISTS(SOL1)
1659
+      #define HAS_SOLENOID_1 1
1660
+    #endif
1650 1661
   #endif
1651 1662
 
1652
-  #if PIN_EXISTS(E2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2))
1653
-    #define HAS_E2_ENABLE 1
1654
-  #endif
1655
-  #if PIN_EXISTS(E2_DIR)
1656
-    #define HAS_E2_DIR 1
1657
-  #endif
1658
-  #if PIN_EXISTS(E2_STEP)
1659
-    #define HAS_E2_STEP 1
1660
-  #endif
1661
-  #if PIN_EXISTS(E2_MS1)
1662
-    #define HAS_E2_MS_PINS 1
1663
-  #endif
1664
-  #if PIN_EXISTS(SOL2)
1665
-    #define HAS_SOLENOID_2 1
1663
+  #if E_STEPPERS > 2
1664
+    #if PIN_EXISTS(E2_ENABLE) || AXIS_IS_L64XX(E2) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2))
1665
+      #define HAS_E2_ENABLE 1
1666
+    #endif
1667
+    #if PIN_EXISTS(E2_DIR)
1668
+      #define HAS_E2_DIR 1
1669
+    #endif
1670
+    #if PIN_EXISTS(E2_STEP)
1671
+      #define HAS_E2_STEP 1
1672
+    #endif
1673
+    #if PIN_EXISTS(E2_MS1)
1674
+      #define HAS_E2_MS_PINS 1
1675
+    #endif
1676
+    #if PIN_EXISTS(SOL2)
1677
+      #define HAS_SOLENOID_2 1
1678
+    #endif
1666 1679
   #endif
1667 1680
 
1668
-  #if PIN_EXISTS(E3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3))
1669
-    #define HAS_E3_ENABLE 1
1670
-  #endif
1671
-  #if PIN_EXISTS(E3_DIR)
1672
-    #define HAS_E3_DIR 1
1673
-  #endif
1674
-  #if PIN_EXISTS(E3_STEP)
1675
-    #define HAS_E3_STEP 1
1676
-  #endif
1677
-  #if PIN_EXISTS(E3_MS1)
1678
-    #define HAS_E3_MS_PINS 1
1679
-  #endif
1680
-  #if PIN_EXISTS(SOL3)
1681
-    #define HAS_SOLENOID_3 1
1681
+  #if E_STEPPERS > 3
1682
+    #if PIN_EXISTS(E3_ENABLE) || AXIS_IS_L64XX(E3) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3))
1683
+      #define HAS_E3_ENABLE 1
1684
+    #endif
1685
+    #if PIN_EXISTS(E3_DIR)
1686
+      #define HAS_E3_DIR 1
1687
+    #endif
1688
+    #if PIN_EXISTS(E3_STEP)
1689
+      #define HAS_E3_STEP 1
1690
+    #endif
1691
+    #if PIN_EXISTS(E3_MS1)
1692
+      #define HAS_E3_MS_PINS 1
1693
+    #endif
1694
+    #if PIN_EXISTS(SOL3)
1695
+      #define HAS_SOLENOID_3 1
1696
+    #endif
1682 1697
   #endif
1683 1698
 
1684
-  #if PIN_EXISTS(E4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4))
1685
-    #define HAS_E4_ENABLE 1
1686
-  #endif
1687
-  #if PIN_EXISTS(E4_DIR)
1688
-    #define HAS_E4_DIR 1
1689
-  #endif
1690
-  #if PIN_EXISTS(E4_STEP)
1691
-    #define HAS_E4_STEP 1
1692
-  #endif
1693
-  #if PIN_EXISTS(E4_MS1)
1694
-    #define HAS_E4_MS_PINS 1
1695
-  #endif
1696
-  #if PIN_EXISTS(SOL4)
1697
-    #define HAS_SOLENOID_4 1
1699
+  #if E_STEPPERS > 4
1700
+    #if PIN_EXISTS(E4_ENABLE) || AXIS_IS_L64XX(E4) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4))
1701
+      #define HAS_E4_ENABLE 1
1702
+    #endif
1703
+    #if PIN_EXISTS(E4_DIR)
1704
+      #define HAS_E4_DIR 1
1705
+    #endif
1706
+    #if PIN_EXISTS(E4_STEP)
1707
+      #define HAS_E4_STEP 1
1708
+    #endif
1709
+    #if PIN_EXISTS(E4_MS1)
1710
+      #define HAS_E4_MS_PINS 1
1711
+    #endif
1712
+    #if PIN_EXISTS(SOL4)
1713
+      #define HAS_SOLENOID_4 1
1714
+    #endif
1698 1715
   #endif
1699 1716
 
1700
-  #if PIN_EXISTS(E5_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5))
1701
-    #define HAS_E5_ENABLE 1
1702
-  #endif
1703
-  #if PIN_EXISTS(E5_DIR)
1704
-    #define HAS_E5_DIR 1
1705
-  #endif
1706
-  #if PIN_EXISTS(E5_STEP)
1707
-    #define HAS_E5_STEP 1
1708
-  #endif
1709
-  #if PIN_EXISTS(E5_MS1)
1710
-    #define HAS_E5_MS_PINS 1
1711
-  #endif
1712
-  #if PIN_EXISTS(SOL5)
1713
-    #define HAS_SOLENOID_5 1
1717
+  #if E_STEPPERS > 5
1718
+    #if PIN_EXISTS(E5_ENABLE) || AXIS_IS_L64XX(E5) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5))
1719
+      #define HAS_E5_ENABLE 1
1720
+    #endif
1721
+    #if PIN_EXISTS(E5_DIR)
1722
+      #define HAS_E5_DIR 1
1723
+    #endif
1724
+    #if PIN_EXISTS(E5_STEP)
1725
+      #define HAS_E5_STEP 1
1726
+    #endif
1727
+    #if PIN_EXISTS(E5_MS1)
1728
+      #define HAS_E5_MS_PINS 1
1729
+    #endif
1730
+    #if PIN_EXISTS(SOL5)
1731
+      #define HAS_SOLENOID_5 1
1732
+    #endif
1714 1733
   #endif
1715 1734
 
1716
-  #if PIN_EXISTS(E6_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E6))
1717
-    #define HAS_E6_ENABLE 1
1718
-  #endif
1719
-  #if PIN_EXISTS(E6_DIR)
1720
-    #define HAS_E6_DIR 1
1721
-  #endif
1722
-  #if PIN_EXISTS(E6_STEP)
1723
-    #define HAS_E6_STEP 1
1724
-  #endif
1725
-  #if PIN_EXISTS(E6_MS1)
1726
-    #define HAS_E6_MS_PINS 1
1727
-  #endif
1728
-  #if PIN_EXISTS(SOL6)
1729
-    #define HAS_SOLENOID_6 1
1735
+  #if E_STEPPERS > 6
1736
+    #if PIN_EXISTS(E6_ENABLE) || AXIS_IS_L64XX(E6) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E6))
1737
+      #define HAS_E6_ENABLE 1
1738
+    #endif
1739
+    #if PIN_EXISTS(E6_DIR)
1740
+      #define HAS_E6_DIR 1
1741
+    #endif
1742
+    #if PIN_EXISTS(E6_STEP)
1743
+      #define HAS_E6_STEP 1
1744
+    #endif
1745
+    #if PIN_EXISTS(E6_MS1)
1746
+      #define HAS_E6_MS_PINS 1
1747
+    #endif
1748
+    #if PIN_EXISTS(SOL6)
1749
+      #define HAS_SOLENOID_6 1
1750
+    #endif
1730 1751
   #endif
1731 1752
 
1732
-  #if PIN_EXISTS(E7_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E7))
1733
-    #define HAS_E7_ENABLE 1
1734
-  #endif
1735
-  #if PIN_EXISTS(E7_DIR)
1736
-    #define HAS_E7_DIR 1
1737
-  #endif
1738
-  #if PIN_EXISTS(E7_STEP)
1739
-    #define HAS_E7_STEP 1
1740
-  #endif
1741
-  #if PIN_EXISTS(E7_MS1)
1742
-    #define HAS_E7_MS_PINS 1
1743
-  #endif
1744
-  #if PIN_EXISTS(SOL7)
1745
-    #define HAS_SOLENOID_7 1
1753
+  #if E_STEPPERS > 7
1754
+    #if PIN_EXISTS(E7_ENABLE) || AXIS_IS_L64XX(E7) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E7))
1755
+      #define HAS_E7_ENABLE 1
1756
+    #endif
1757
+    #if PIN_EXISTS(E7_DIR)
1758
+      #define HAS_E7_DIR 1
1759
+    #endif
1760
+    #if PIN_EXISTS(E7_STEP)
1761
+      #define HAS_E7_STEP 1
1762
+    #endif
1763
+    #if PIN_EXISTS(E7_MS1)
1764
+      #define HAS_E7_MS_PINS 1
1765
+    #endif
1766
+    #if PIN_EXISTS(SOL7)
1767
+      #define HAS_SOLENOID_7 1
1768
+    #endif
1746 1769
   #endif
1747 1770
 
1771
+  #if !defined(DISABLE_INACTIVE_E) && ENABLED(DISABLE_E)
1772
+    #define DISABLE_INACTIVE_E 1
1773
+  #endif
1774
+#else
1775
+  #undef DISABLE_INACTIVE_E
1748 1776
 #endif // HAS_EXTRUDERS
1749 1777
 
1750 1778
 //
@@ -1997,12 +2025,6 @@
1997 2025
   #endif
1998 2026
 #endif
1999 2027
 
2000
-#if (HAS_E_DRIVER(TMC2660) \
2001
-  || ( E0_ENABLE_PIN != X_ENABLE_PIN && E1_ENABLE_PIN != X_ENABLE_PIN   \
2002
-    && E0_ENABLE_PIN != Y_ENABLE_PIN && E1_ENABLE_PIN != Y_ENABLE_PIN ) )
2003
-  #define HAS_E_STEPPER_ENABLE 1
2004
-#endif
2005
-
2006 2028
 #if ANY_AXIS_HAS(HW_SERIAL)
2007 2029
   #define HAS_TMC_HW_SERIAL 1
2008 2030
 #endif
@@ -3260,11 +3282,6 @@
3260 3282
   #define SD_SPI_SPEED SPI_FULL_SPEED
3261 3283
 #endif
3262 3284
 
3263
-// Defined here to catch the above defines
3264
-#if ENABLED(SDCARD_SORT_ALPHA) && (FOLDER_SORTING || ENABLED(SDSORT_GCODE))
3265
-  #define HAS_FOLDER_SORTING 1
3266
-#endif
3267
-
3268 3285
 #if HAS_WIRED_LCD
3269 3286
   // Get LCD character width/height, which may be overridden by pins, configs, etc.
3270 3287
   #ifndef LCD_WIDTH

+ 24
- 40
Marlin/src/inc/SanityCheck.h Целия файл

@@ -2355,46 +2355,30 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
2355 2355
   #endif
2356 2356
 #endif
2357 2357
 
2358
-#if E_STEPPERS
2359
-  #if !(PINS_EXIST(E0_STEP, E0_DIR) && HAS_E0_ENABLE)
2360
-    #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
2361
-  #endif
2362
-  #if E_STEPPERS > 1
2363
-    #if !(PINS_EXIST(E1_STEP, E1_DIR) && HAS_E1_ENABLE)
2364
-      #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
2365
-    #endif
2366
-    #if E_STEPPERS > 2
2367
-      #if !(PINS_EXIST(E2_STEP, E2_DIR) && HAS_E2_ENABLE)
2368
-        #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
2369
-      #endif
2370
-      #if E_STEPPERS > 3
2371
-        #if !(PINS_EXIST(E3_STEP, E3_DIR) && HAS_E3_ENABLE)
2372
-          #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
2373
-        #endif
2374
-        #if E_STEPPERS > 4
2375
-          #if !(PINS_EXIST(E4_STEP, E4_DIR) && HAS_E4_ENABLE)
2376
-            #error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board."
2377
-          #endif
2378
-          #if E_STEPPERS > 5
2379
-            #if !(PINS_EXIST(E5_STEP, E5_DIR) && HAS_E5_ENABLE)
2380
-              #error "E5_STEP_PIN, E5_DIR_PIN, or E5_ENABLE_PIN not defined for this board."
2381
-            #endif
2382
-            #if E_STEPPERS > 6
2383
-              #if !(PINS_EXIST(E6_STEP, E6_DIR) && HAS_E6_ENABLE)
2384
-                #error "E6_STEP_PIN, E6_DIR_PIN, or E6_ENABLE_PIN not defined for this board."
2385
-              #endif
2386
-              #if E_STEPPERS > 7
2387
-                #if !(PINS_EXIST(E7_STEP, E7_DIR) && HAS_E7_ENABLE)
2388
-                  #error "E7_STEP_PIN, E7_DIR_PIN, or E7_ENABLE_PIN not defined for this board."
2389
-                #endif
2390
-              #endif // E_STEPPERS > 7
2391
-            #endif // E_STEPPERS > 6
2392
-          #endif // E_STEPPERS > 5
2393
-        #endif // E_STEPPERS > 4
2394
-      #endif // E_STEPPERS > 3
2395
-    #endif // E_STEPPERS > 2
2396
-  #endif // E_STEPPERS > 1
2397
-#endif // E_STEPPERS
2358
+#if E_STEPPERS > 0 && !(PINS_EXIST(E0_STEP, E0_DIR) && HAS_E0_ENABLE)
2359
+  #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
2360
+#endif
2361
+#if E_STEPPERS > 1 && !(PINS_EXIST(E1_STEP, E1_DIR) && HAS_E1_ENABLE)
2362
+  #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
2363
+#endif
2364
+#if E_STEPPERS > 2 && !(PINS_EXIST(E2_STEP, E2_DIR) && HAS_E2_ENABLE)
2365
+  #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
2366
+#endif
2367
+#if E_STEPPERS > 3 && !(PINS_EXIST(E3_STEP, E3_DIR) && HAS_E3_ENABLE)
2368
+  #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
2369
+#endif
2370
+#if E_STEPPERS > 4 && !(PINS_EXIST(E4_STEP, E4_DIR) && HAS_E4_ENABLE)
2371
+  #error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board."
2372
+#endif
2373
+#if E_STEPPERS > 5 && !(PINS_EXIST(E5_STEP, E5_DIR) && HAS_E5_ENABLE)
2374
+  #error "E5_STEP_PIN, E5_DIR_PIN, or E5_ENABLE_PIN not defined for this board."
2375
+#endif
2376
+#if E_STEPPERS > 6 && !(PINS_EXIST(E6_STEP, E6_DIR) && HAS_E6_ENABLE)
2377
+  #error "E6_STEP_PIN, E6_DIR_PIN, or E6_ENABLE_PIN not defined for this board."
2378
+#endif
2379
+#if E_STEPPERS > 7 && !(PINS_EXIST(E7_STEP, E7_DIR) && HAS_E7_ENABLE)
2380
+  #error "E7_STEP_PIN, E7_DIR_PIN, or E7_ENABLE_PIN not defined for this board."
2381
+#endif
2398 2382
 
2399 2383
 /**
2400 2384
  * Endstop Tests

+ 5
- 11
Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp Целия файл

@@ -229,13 +229,9 @@ void DGUSRxHandler::Flowrate(DGUS_VP &vp, void *data_ptr) {
229 229
   switch (vp.addr) {
230 230
     default: return;
231 231
     case DGUS_Addr::ADJUST_SetFlowrate_CUR:
232
-      #if EXTRUDERS > 1
233
-        ExtUI::setFlow_percent(flowrate, ExtUI::getActiveTool());
234
-      #else
235
-        ExtUI::setFlow_percent(flowrate, ExtUI::E0);
236
-      #endif
232
+      ExtUI::setFlow_percent(flowrate, TERN(HAS_MULTI_EXTRUDER, ExtUI::getActiveTool(), ExtUI::E0));
237 233
       break;
238
-    #if EXTRUDERS > 1
234
+    #if HAS_MULTI_EXTRUDER
239 235
       case DGUS_Addr::ADJUST_SetFlowrate_E0:
240 236
         ExtUI::setFlow_percent(flowrate, ExtUI::E0);
241 237
         break;
@@ -557,9 +553,7 @@ void DGUSRxHandler::FilamentSelect(DGUS_VP &vp, void *data_ptr) {
557 553
     default: return;
558 554
     case DGUS_Data::Extruder::CURRENT:
559 555
     case DGUS_Data::Extruder::E0:
560
-    #if EXTRUDERS > 1
561
-      case DGUS_Data::Extruder::E1:
562
-    #endif
556
+    TERN_(HAS_MULTI_EXTRUDER, case DGUS_Data::Extruder::E1:)
563 557
       dgus_screen_handler.filament_extruder = extruder;
564 558
       break;
565 559
   }
@@ -590,14 +584,14 @@ void DGUSRxHandler::FilamentMove(DGUS_VP &vp, void *data_ptr) {
590 584
   switch (dgus_screen_handler.filament_extruder) {
591 585
     default: return;
592 586
     case DGUS_Data::Extruder::CURRENT:
593
-      #if EXTRUDERS > 1
587
+      #if HAS_MULTI_EXTRUDER
594 588
         extruder = ExtUI::getActiveTool();
595 589
         break;
596 590
       #endif
597 591
     case DGUS_Data::Extruder::E0:
598 592
       extruder = ExtUI::E0;
599 593
       break;
600
-    #if EXTRUDERS > 1
594
+    #if HAS_MULTI_EXTRUDER
601 595
       case DGUS_Data::Extruder::E1:
602 596
         extruder = ExtUI::E1;
603 597
         break;

+ 3
- 7
Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp Целия файл

@@ -249,13 +249,9 @@ void DGUSTxHandler::Flowrate(DGUS_VP &vp) {
249 249
   switch (vp.addr) {
250 250
     default: return;
251 251
     case DGUS_Addr::ADJUST_Flowrate_CUR:
252
-      #if EXTRUDERS > 1
253
-        flowrate = ExtUI::getFlow_percent(ExtUI::getActiveTool());
254
-      #else
255
-        flowrate = ExtUI::getFlow_percent(ExtUI::E0);
256
-      #endif
252
+      flowrate = ExtUI::getFlow_percent(TERN(HAS_MULTI_EXTRUDER, ExtUI::getActiveTool(), ExtUI::E0));
257 253
       break;
258
-    #if EXTRUDERS > 1
254
+    #if HAS_MULTI_EXTRUDER
259 255
       case DGUS_Addr::ADJUST_Flowrate_E0:
260 256
         flowrate = ExtUI::getFlow_percent(ExtUI::E0);
261 257
         break;
@@ -366,7 +362,7 @@ void DGUSTxHandler::FilamentIcons(DGUS_VP &vp) {
366 362
   switch (dgus_screen_handler.filament_extruder) {
367 363
     default: return;
368 364
     case DGUS_Data::Extruder::CURRENT:
369
-      #if EXTRUDERS > 1
365
+      #if HAS_MULTI_EXTRUDER
370 366
         switch (ExtUI::getActiveTool()) {
371 367
           default: break;
372 368
           case ExtUI::E0:

+ 2
- 2
Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h Целия файл

@@ -55,7 +55,7 @@ enum class DGUS_Addr : uint16_t {
55 55
   STATUS_Resume             = 0x2009, // Popup / Data: DGUS_Data::Popup
56 56
   ADJUST_SetFeedrate        = 0x200A, // Type: Integer (16 bits signed)
57 57
   ADJUST_SetFlowrate_CUR    = 0x200B, // Type: Integer (16 bits signed)
58
-  #if EXTRUDERS > 1
58
+  #if HAS_MULTI_EXTRUDER
59 59
     ADJUST_SetFlowrate_E0   = 0x200C, // Type: Integer (16 bits signed)
60 60
     ADJUST_SetFlowrate_E1   = 0x200D, // Type: Integer (16 bits signed)
61 61
   #endif
@@ -113,7 +113,7 @@ enum class DGUS_Addr : uint16_t {
113 113
   STATUS_Icons              = 0x30F7, // Bits: DGUS_Data::StatusIcon
114 114
   ADJUST_Feedrate           = 0x30F8, // Type: Integer (16 bits signed)
115 115
   ADJUST_Flowrate_CUR       = 0x30F9, // Type: Integer (16 bits signed)
116
-  #if EXTRUDERS > 1
116
+  #if HAS_MULTI_EXTRUDER
117 117
     ADJUST_Flowrate_E0      = 0x30FA, // Type: Integer (16 bits signed)
118 118
     ADJUST_Flowrate_E1      = 0x30FB, // Type: Integer (16 bits signed)
119 119
   #endif

+ 2
- 2
Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp Целия файл

@@ -92,7 +92,7 @@ const struct DGUS_VP vp_list[] PROGMEM = {
92 92
 
93 93
   VP_HELPER_RX(DGUS_Addr::ADJUST_SetFeedrate,     &DGUSRxHandler::Feedrate),
94 94
   VP_HELPER_RX(DGUS_Addr::ADJUST_SetFlowrate_CUR, &DGUSRxHandler::Flowrate),
95
-  #if EXTRUDERS > 1
95
+  #if HAS_MULTI_EXTRUDER
96 96
     VP_HELPER_RX(DGUS_Addr::ADJUST_SetFlowrate_E0,  &DGUSRxHandler::Flowrate),
97 97
     VP_HELPER_RX(DGUS_Addr::ADJUST_SetFlowrate_E1,  &DGUSRxHandler::Flowrate),
98 98
   #endif
@@ -194,7 +194,7 @@ const struct DGUS_VP vp_list[] PROGMEM = {
194 194
   VP_HELPER_TX_AUTO(DGUS_Addr::ADJUST_Flowrate_CUR,
195 195
                     nullptr,
196 196
                     &DGUSTxHandler::Flowrate),
197
-  #if EXTRUDERS > 1
197
+  #if HAS_MULTI_EXTRUDER
198 198
     VP_HELPER_TX_AUTO(DGUS_Addr::ADJUST_Flowrate_E0,
199 199
                       nullptr,
200 200
                       &DGUSTxHandler::Flowrate),

+ 2
- 2
Marlin/src/lcd/extui/mks_ui/wifi_module.cpp Целия файл

@@ -988,11 +988,11 @@ static void wifi_gcode_exec(uint8_t *cmd_line) {
988 988
                   if (card.isFileOpen()) {
989 989
                     //saved_feedrate_percentage = feedrate_percentage;
990 990
                     feedrate_percentage = 100;
991
-                    #if EXTRUDERS
991
+                    #if HAS_EXTRUDERS
992 992
                       planner.flow_percentage[0] = 100;
993 993
                       planner.e_factor[0] = planner.flow_percentage[0] * 0.01f;
994 994
                     #endif
995
-                    #if EXTRUDERS == 2
995
+                    #if HAS_MULTI_EXTRUDER
996 996
                       planner.flow_percentage[1] = 100;
997 997
                       planner.e_factor[1] = planner.flow_percentage[1] * 0.01f;
998 998
                     #endif

+ 12
- 12
Marlin/src/module/probe.cpp Целия файл

@@ -48,8 +48,17 @@
48 48
   #include "delta.h"
49 49
 #endif
50 50
 
51
-#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
52
-  #include "planner.h"
51
+#if ANY(HAS_QUIET_PROBING, USE_SENSORLESS)
52
+  #include "stepper/indirection.h"
53
+  #if BOTH(HAS_QUIET_PROBING, PROBING_ESTEPPERS_OFF)
54
+    #include "stepper.h"
55
+  #endif
56
+  #if USE_SENSORLESS
57
+    #include "../feature/tmc_util.h"
58
+    #if ENABLED(IMPROVE_HOMING_RELIABILITY)
59
+      #include "planner.h"
60
+    #endif
61
+  #endif
53 62
 #endif
54 63
 
55 64
 #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING)
@@ -68,15 +77,6 @@
68 77
   #include "servo.h"
69 78
 #endif
70 79
 
71
-#if EITHER(SENSORLESS_PROBING, SENSORLESS_HOMING)
72
-  #include "stepper.h"
73
-  #include "../feature/tmc_util.h"
74
-#endif
75
-
76
-#if HAS_QUIET_PROBING
77
-  #include "stepper/indirection.h"
78
-#endif
79
-
80 80
 #if ENABLED(EXTENSIBLE_UI)
81 81
   #include "../lcd/extui/ui_api.h"
82 82
 #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
@@ -818,7 +818,7 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
818 818
 
819 819
 #endif // HAS_Z_SERVO_PROBE
820 820
 
821
-#if EITHER(SENSORLESS_PROBING, SENSORLESS_HOMING)
821
+#if USE_SENSORLESS
822 822
 
823 823
   sensorless_t stealth_states { false };
824 824
 

+ 1
- 1
Marlin/src/module/probe.h Целия файл

@@ -263,7 +263,7 @@ public:
263 263
   #endif
264 264
 
265 265
   // Basic functions for Sensorless Homing and Probing
266
-  #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING)
266
+  #if USE_SENSORLESS
267 267
     static void enable_stallguard_diag1();
268 268
     static void disable_stallguard_diag1();
269 269
     static void set_homing_current(const bool onoff);

+ 24
- 120
Marlin/src/module/stepper/indirection.h Целия файл

@@ -667,183 +667,87 @@ void reset_stepper_drivers();    // Called by settings.load / settings.reset
667 667
 //
668 668
 
669 669
 #ifndef ENABLE_STEPPER_X
670
-  #if HAS_X_ENABLE
671
-    #define  ENABLE_STEPPER_X() X_ENABLE_WRITE( X_ENABLE_ON)
672
-  #else
673
-    #define  ENABLE_STEPPER_X() NOOP
674
-  #endif
670
+  #define  ENABLE_STEPPER_X() TERN(HAS_X_ENABLE, X_ENABLE_WRITE( X_ENABLE_ON), NOOP)
675 671
 #endif
676 672
 #ifndef DISABLE_STEPPER_X
677
-  #if HAS_X_ENABLE
678
-    #define DISABLE_STEPPER_X() X_ENABLE_WRITE(!X_ENABLE_ON)
679
-  #else
680
-    #define DISABLE_STEPPER_X() NOOP
681
-  #endif
673
+  #define DISABLE_STEPPER_X() TERN(HAS_X_ENABLE, X_ENABLE_WRITE(!X_ENABLE_ON), NOOP)
682 674
 #endif
683 675
 
684 676
 #ifndef ENABLE_STEPPER_X2
685
-  #if HAS_X2_ENABLE
686
-    #define  ENABLE_STEPPER_X2() X2_ENABLE_WRITE( X_ENABLE_ON)
687
-  #else
688
-    #define  ENABLE_STEPPER_X2() NOOP
689
-  #endif
677
+  #define  ENABLE_STEPPER_X2() TERN(HAS_X2_ENABLE, X2_ENABLE_WRITE( X_ENABLE_ON), NOOP)
690 678
 #endif
691 679
 #ifndef DISABLE_STEPPER_X2
692
-  #if HAS_X2_ENABLE
693
-    #define DISABLE_STEPPER_X2() X2_ENABLE_WRITE(!X_ENABLE_ON)
694
-  #else
695
-    #define DISABLE_STEPPER_X2() NOOP
696
-  #endif
680
+  #define DISABLE_STEPPER_X2() TERN(HAS_X2_ENABLE, X2_ENABLE_WRITE(!X_ENABLE_ON), NOOP)
697 681
 #endif
698 682
 
699 683
 #ifndef ENABLE_STEPPER_Y
700
-  #if HAS_Y_ENABLE
701
-    #define  ENABLE_STEPPER_Y() Y_ENABLE_WRITE( Y_ENABLE_ON)
702
-  #else
703
-    #define  ENABLE_STEPPER_Y() NOOP
704
-  #endif
684
+  #define  ENABLE_STEPPER_Y() TERN(HAS_Y_ENABLE, Y_ENABLE_WRITE( Y_ENABLE_ON), NOOP)
705 685
 #endif
706 686
 #ifndef DISABLE_STEPPER_Y
707
-  #if HAS_Y_ENABLE
708
-    #define DISABLE_STEPPER_Y() Y_ENABLE_WRITE(!Y_ENABLE_ON)
709
-  #else
710
-    #define DISABLE_STEPPER_Y() NOOP
711
-  #endif
687
+  #define DISABLE_STEPPER_Y() TERN(HAS_Y_ENABLE, Y_ENABLE_WRITE(!Y_ENABLE_ON), NOOP)
712 688
 #endif
713 689
 
714 690
 #ifndef ENABLE_STEPPER_Y2
715
-  #if HAS_Y2_ENABLE
716
-    #define  ENABLE_STEPPER_Y2() Y2_ENABLE_WRITE( Y_ENABLE_ON)
717
-  #else
718
-    #define  ENABLE_STEPPER_Y2() NOOP
719
-  #endif
691
+  #define  ENABLE_STEPPER_Y2() TERN(HAS_Y2_ENABLE, Y2_ENABLE_WRITE( Y_ENABLE_ON), NOOP)
720 692
 #endif
721 693
 #ifndef DISABLE_STEPPER_Y2
722
-  #if HAS_Y2_ENABLE
723
-    #define DISABLE_STEPPER_Y2() Y2_ENABLE_WRITE(!Y_ENABLE_ON)
724
-  #else
725
-    #define DISABLE_STEPPER_Y2() NOOP
726
-  #endif
694
+  #define DISABLE_STEPPER_Y2() TERN(HAS_Y2_ENABLE, Y2_ENABLE_WRITE(!Y_ENABLE_ON), NOOP)
727 695
 #endif
728 696
 
729 697
 #ifndef ENABLE_STEPPER_Z
730
-  #if HAS_Z_ENABLE
731
-    #define  ENABLE_STEPPER_Z() Z_ENABLE_WRITE( Z_ENABLE_ON)
732
-  #else
733
-    #define  ENABLE_STEPPER_Z() NOOP
734
-  #endif
698
+  #define  ENABLE_STEPPER_Z() TERN(HAS_Z_ENABLE, Z_ENABLE_WRITE( Z_ENABLE_ON), NOOP)
735 699
 #endif
736 700
 #ifndef DISABLE_STEPPER_Z
737
-  #if HAS_Z_ENABLE
738
-    #define DISABLE_STEPPER_Z() Z_ENABLE_WRITE(!Z_ENABLE_ON)
739
-  #else
740
-    #define DISABLE_STEPPER_Z() NOOP
741
-  #endif
701
+  #define DISABLE_STEPPER_Z() TERN(HAS_Z_ENABLE, Z_ENABLE_WRITE(!Z_ENABLE_ON), NOOP)
742 702
 #endif
743 703
 
744 704
 #ifndef ENABLE_STEPPER_Z2
745
-  #if HAS_Z2_ENABLE
746
-    #define  ENABLE_STEPPER_Z2() Z2_ENABLE_WRITE( Z_ENABLE_ON)
747
-  #else
748
-    #define  ENABLE_STEPPER_Z2() NOOP
749
-  #endif
705
+  #define  ENABLE_STEPPER_Z2() TERN(HAS_Z2_ENABLE, Z2_ENABLE_WRITE( Z_ENABLE_ON), NOOP)
750 706
 #endif
751 707
 #ifndef DISABLE_STEPPER_Z2
752
-  #if HAS_Z2_ENABLE
753
-    #define DISABLE_STEPPER_Z2() Z2_ENABLE_WRITE(!Z_ENABLE_ON)
754
-  #else
755
-    #define DISABLE_STEPPER_Z2() NOOP
756
-  #endif
708
+  #define DISABLE_STEPPER_Z2() TERN(HAS_Z2_ENABLE, Z2_ENABLE_WRITE(!Z_ENABLE_ON), NOOP)
757 709
 #endif
758 710
 
759 711
 #ifndef ENABLE_STEPPER_Z3
760
-  #if HAS_Z3_ENABLE
761
-    #define  ENABLE_STEPPER_Z3() Z3_ENABLE_WRITE( Z_ENABLE_ON)
762
-  #else
763
-    #define  ENABLE_STEPPER_Z3() NOOP
764
-  #endif
712
+  #define  ENABLE_STEPPER_Z3() TERN(HAS_Z3_ENABLE, Z3_ENABLE_WRITE( Z_ENABLE_ON), NOOP)
765 713
 #endif
766 714
 #ifndef DISABLE_STEPPER_Z3
767
-  #if HAS_Z3_ENABLE
768
-    #define DISABLE_STEPPER_Z3() Z3_ENABLE_WRITE(!Z_ENABLE_ON)
769
-  #else
770
-    #define DISABLE_STEPPER_Z3() NOOP
771
-  #endif
715
+  #define DISABLE_STEPPER_Z3() TERN(HAS_Z3_ENABLE, Z3_ENABLE_WRITE(!Z_ENABLE_ON), NOOP)
772 716
 #endif
773 717
 
774 718
 #ifndef ENABLE_STEPPER_Z4
775
-  #if HAS_Z4_ENABLE
776
-    #define  ENABLE_STEPPER_Z4() Z4_ENABLE_WRITE( Z_ENABLE_ON)
777
-  #else
778
-    #define  ENABLE_STEPPER_Z4() NOOP
779
-  #endif
719
+  #define  ENABLE_STEPPER_Z4() TERN(HAS_Z4_ENABLE, Z4_ENABLE_WRITE( Z_ENABLE_ON), NOOP)
780 720
 #endif
781 721
 #ifndef DISABLE_STEPPER_Z4
782
-  #if HAS_Z4_ENABLE
783
-    #define DISABLE_STEPPER_Z4() Z4_ENABLE_WRITE(!Z_ENABLE_ON)
784
-  #else
785
-    #define DISABLE_STEPPER_Z4() NOOP
786
-  #endif
722
+  #define DISABLE_STEPPER_Z4() TERN(HAS_Z4_ENABLE, Z4_ENABLE_WRITE(!Z_ENABLE_ON), NOOP)
787 723
 #endif
788 724
 
789 725
 #ifndef ENABLE_STEPPER_I
790
-  #if HAS_I_ENABLE
791
-    #define  ENABLE_STEPPER_I() I_ENABLE_WRITE( I_ENABLE_ON)
792
-  #else
793
-    #define  ENABLE_STEPPER_I() NOOP
794
-  #endif
726
+  #define  ENABLE_STEPPER_I() TERN(HAS_I_ENABLE, I_ENABLE_WRITE( I_ENABLE_ON), NOOP)
795 727
 #endif
796 728
 #ifndef DISABLE_STEPPER_I
797
-  #if HAS_I_ENABLE
798
-    #define DISABLE_STEPPER_I() I_ENABLE_WRITE(!I_ENABLE_ON)
799
-  #else
800
-    #define DISABLE_STEPPER_I() NOOP
801
-  #endif
729
+  #define DISABLE_STEPPER_I() TERN(HAS_I_ENABLE, I_ENABLE_WRITE(!I_ENABLE_ON), NOOP)
802 730
 #endif
803 731
 
804 732
 #ifndef ENABLE_STEPPER_J
805
-  #if HAS_J_ENABLE
806
-    #define  ENABLE_STEPPER_J() J_ENABLE_WRITE( J_ENABLE_ON)
807
-  #else
808
-    #define  ENABLE_STEPPER_J() NOOP
809
-  #endif
733
+  #define  ENABLE_STEPPER_J() TERN(HAS_J_ENABLE, J_ENABLE_WRITE( J_ENABLE_ON), NOOP)
810 734
 #endif
811 735
 #ifndef DISABLE_STEPPER_J
812
-  #if HAS_J_ENABLE
813
-    #define DISABLE_STEPPER_J() J_ENABLE_WRITE(!J_ENABLE_ON)
814
-  #else
815
-    #define DISABLE_STEPPER_J() NOOP
816
-  #endif
736
+  #define DISABLE_STEPPER_J() TERN(HAS_J_ENABLE, J_ENABLE_WRITE(!J_ENABLE_ON), NOOP)
817 737
 #endif
818 738
 
819 739
 #ifndef ENABLE_STEPPER_K
820
-  #if HAS_K_ENABLE
821
-    #define  ENABLE_STEPPER_K() K_ENABLE_WRITE( K_ENABLE_ON)
822
-  #else
823
-    #define  ENABLE_STEPPER_K() NOOP
824
-  #endif
740
+  #define  ENABLE_STEPPER_K() TERN(HAS_K_ENABLE, K_ENABLE_WRITE( K_ENABLE_ON), NOOP)
825 741
 #endif
826 742
 #ifndef DISABLE_STEPPER_K
827
-  #if HAS_K_ENABLE
828
-    #define DISABLE_STEPPER_K() K_ENABLE_WRITE(!K_ENABLE_ON)
829
-  #else
830
-    #define DISABLE_STEPPER_K() NOOP
831
-  #endif
743
+  #define DISABLE_STEPPER_K() TERN(HAS_K_ENABLE, K_ENABLE_WRITE(!K_ENABLE_ON), NOOP)
832 744
 #endif
833 745
 
834 746
 #ifndef ENABLE_STEPPER_E0
835
-  #if HAS_E0_ENABLE
836
-    #define  ENABLE_STEPPER_E0() E0_ENABLE_WRITE( E_ENABLE_ON)
837
-  #else
838
-    #define  ENABLE_STEPPER_E0() NOOP
839
-  #endif
747
+  #define  ENABLE_STEPPER_E0() TERN(HAS_E0_ENABLE, E0_ENABLE_WRITE( E_ENABLE_ON), NOOP)
840 748
 #endif
841 749
 #ifndef DISABLE_STEPPER_E0
842
-  #if HAS_E0_ENABLE
843
-    #define DISABLE_STEPPER_E0() E0_ENABLE_WRITE(!E_ENABLE_ON)
844
-  #else
845
-    #define DISABLE_STEPPER_E0() NOOP
846
-  #endif
750
+  #define DISABLE_STEPPER_E0() TERN(HAS_E0_ENABLE, E0_ENABLE_WRITE(!E_ENABLE_ON), NOOP)
847 751
 #endif
848 752
 
849 753
 #ifndef ENABLE_STEPPER_E1

+ 9
- 9
Marlin/src/module/stepper/trinamic.h Целия файл

@@ -194,7 +194,7 @@ void reset_trinamic_drivers();
194 194
     #define CHOPPER_TIMING_Z2 CHOPPER_TIMING_Z
195 195
   #endif
196 196
   static constexpr chopper_timing_t chopper_timing_Z2 = CHOPPER_TIMING_Z2;
197
-  #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2)
197
+  #if ENABLED(SOFTWARE_DRIVER_ENABLE)
198 198
     #define Z2_ENABLE_INIT() NOOP
199 199
     #define Z2_ENABLE_WRITE(STATE) stepperZ2.toff((STATE)==Z_ENABLE_ON ? chopper_timing_Z2.toff : 0)
200 200
     #define Z2_ENABLE_READ() stepperZ2.isEnabled()
@@ -287,7 +287,7 @@ void reset_trinamic_drivers();
287 287
     #define CHOPPER_TIMING_E0 CHOPPER_TIMING_E
288 288
   #endif
289 289
   static constexpr chopper_timing_t chopper_timing_E0 = CHOPPER_TIMING_E0;
290
-  #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0)
290
+  #if ENABLED(SOFTWARE_DRIVER_ENABLE)
291 291
     #define E0_ENABLE_INIT() NOOP
292 292
     #define E0_ENABLE_WRITE(STATE) stepperE0.toff((STATE)==E_ENABLE_ON ? chopper_timing_E0.toff : 0)
293 293
     #define E0_ENABLE_READ() stepperE0.isEnabled()
@@ -304,7 +304,7 @@ void reset_trinamic_drivers();
304 304
     #define CHOPPER_TIMING_E1 CHOPPER_TIMING_E
305 305
   #endif
306 306
   static constexpr chopper_timing_t chopper_timing_E1 = CHOPPER_TIMING_E1;
307
-  #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1)
307
+  #if ENABLED(SOFTWARE_DRIVER_ENABLE)
308 308
     #define E1_ENABLE_INIT() NOOP
309 309
     #define E1_ENABLE_WRITE(STATE) stepperE1.toff((STATE)==E_ENABLE_ON ? chopper_timing_E1.toff : 0)
310 310
     #define E1_ENABLE_READ() stepperE1.isEnabled()
@@ -321,7 +321,7 @@ void reset_trinamic_drivers();
321 321
     #define CHOPPER_TIMING_E2 CHOPPER_TIMING_E
322 322
   #endif
323 323
   static constexpr chopper_timing_t chopper_timing_E2 = CHOPPER_TIMING_E2;
324
-  #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2)
324
+  #if ENABLED(SOFTWARE_DRIVER_ENABLE)
325 325
     #define E2_ENABLE_INIT() NOOP
326 326
     #define E2_ENABLE_WRITE(STATE) stepperE2.toff((STATE)==E_ENABLE_ON ? chopper_timing_E2.toff : 0)
327 327
     #define E2_ENABLE_READ() stepperE2.isEnabled()
@@ -338,7 +338,7 @@ void reset_trinamic_drivers();
338 338
     #define CHOPPER_TIMING_E3 CHOPPER_TIMING_E
339 339
   #endif
340 340
   static constexpr chopper_timing_t chopper_timing_E3 = CHOPPER_TIMING_E3;
341
-  #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3)
341
+  #if ENABLED(SOFTWARE_DRIVER_ENABLE)
342 342
     #define E3_ENABLE_INIT() NOOP
343 343
     #define E3_ENABLE_WRITE(STATE) stepperE3.toff((STATE)==E_ENABLE_ON ? chopper_timing_E3.toff : 0)
344 344
     #define E3_ENABLE_READ() stepperE3.isEnabled()
@@ -355,7 +355,7 @@ void reset_trinamic_drivers();
355 355
     #define CHOPPER_TIMING_E4 CHOPPER_TIMING_E
356 356
   #endif
357 357
   static constexpr chopper_timing_t chopper_timing_E4 = CHOPPER_TIMING_E4;
358
-  #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4)
358
+  #if ENABLED(SOFTWARE_DRIVER_ENABLE)
359 359
     #define E4_ENABLE_INIT() NOOP
360 360
     #define E4_ENABLE_WRITE(STATE) stepperE4.toff((STATE)==E_ENABLE_ON ? chopper_timing_E4.toff : 0)
361 361
     #define E4_ENABLE_READ() stepperE4.isEnabled()
@@ -372,7 +372,7 @@ void reset_trinamic_drivers();
372 372
     #define CHOPPER_TIMING_E5 CHOPPER_TIMING_E
373 373
   #endif
374 374
   static constexpr chopper_timing_t chopper_timing_E5 = CHOPPER_TIMING_E5;
375
-  #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5)
375
+  #if ENABLED(SOFTWARE_DRIVER_ENABLE)
376 376
     #define E5_ENABLE_INIT() NOOP
377 377
     #define E5_ENABLE_WRITE(STATE) stepperE5.toff((STATE)==E_ENABLE_ON ? chopper_timing_E5.toff : 0)
378 378
     #define E5_ENABLE_READ() stepperE5.isEnabled()
@@ -389,7 +389,7 @@ void reset_trinamic_drivers();
389 389
     #define CHOPPER_TIMING_E6 CHOPPER_TIMING_E
390 390
   #endif
391 391
   static constexpr chopper_timing_t chopper_timing_E6 = CHOPPER_TIMING_E6;
392
-  #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E6)
392
+  #if ENABLED(SOFTWARE_DRIVER_ENABLE)
393 393
     #define E6_ENABLE_INIT() NOOP
394 394
     #define E6_ENABLE_WRITE(STATE) stepperE6.toff((STATE)==E_ENABLE_ON ? chopper_timing_E6.toff : 0)
395 395
     #define E6_ENABLE_READ() stepperE6.isEnabled()
@@ -406,7 +406,7 @@ void reset_trinamic_drivers();
406 406
     #define CHOPPER_TIMING_E7 CHOPPER_TIMING_E
407 407
   #endif
408 408
   static constexpr chopper_timing_t chopper_timing_E7 = CHOPPER_TIMING_E7;
409
-  #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E7)
409
+  #if ENABLED(SOFTWARE_DRIVER_ENABLE)
410 410
     #define E7_ENABLE_INIT() NOOP
411 411
     #define E7_ENABLE_WRITE(STATE) stepperE7.toff((STATE)==E_ENABLE_ON ? chopper_timing_E7.toff : 0)
412 412
     #define E7_ENABLE_READ() stepperE7.isEnabled()

+ 7
- 2
Marlin/src/sd/cardreader.h Целия файл

@@ -27,8 +27,13 @@
27 27
 
28 28
 extern const char M23_STR[], M24_STR[];
29 29
 
30
-#if BOTH(SDCARD_SORT_ALPHA, SDSORT_DYNAMIC_RAM)
31
-  #define SD_RESORT 1
30
+#if ENABLED(SDCARD_SORT_ALPHA)
31
+  #if ENABLED(SDSORT_DYNAMIC_RAM)
32
+    #define SD_RESORT 1
33
+  #endif
34
+  #if FOLDER_SORTING || ENABLED(SDSORT_GCODE)
35
+    #define HAS_FOLDER_SORTING 1
36
+  #endif
32 37
 #endif
33 38
 
34 39
 #if ENABLED(SDCARD_RATHERRECENTFIRST) && DISABLED(SDCARD_SORT_ALPHA)

Loading…
Отказ
Запис