Pārlūkot izejas kodu

Implement SERVO_DELAY as array

This modify give SERVO_DELAY x servo basis
GMagician 6 gadus atpakaļ
vecāks
revīzija
e9c72978c7
37 mainītis faili ar 39 papildinājumiem un 36 dzēšanām
  1. 1
    0
      .travis.yml
  2. 1
    1
      Marlin/Conditionals_LCD.h
  3. 1
    1
      Marlin/Configuration.h
  4. 1
    1
      Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h
  5. 1
    1
      Marlin/example_configurations/AliExpress/CL-260/Configuration.h
  6. 1
    1
      Marlin/example_configurations/Anet/A6/Configuration.h
  7. 1
    1
      Marlin/example_configurations/Anet/A8/Configuration.h
  8. 1
    1
      Marlin/example_configurations/BQ/Hephestos/Configuration.h
  9. 1
    1
      Marlin/example_configurations/BQ/Hephestos_2/Configuration.h
  10. 1
    1
      Marlin/example_configurations/BQ/WITBOX/Configuration.h
  11. 1
    1
      Marlin/example_configurations/Cartesio/Configuration.h
  12. 1
    1
      Marlin/example_configurations/Creality/CR-10/Configuration.h
  13. 1
    1
      Marlin/example_configurations/Felix/Configuration.h
  14. 1
    1
      Marlin/example_configurations/Felix/DUAL/Configuration.h
  15. 1
    1
      Marlin/example_configurations/Geeetech/GT2560/Configuration.h
  16. 1
    1
      Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h
  17. 1
    1
      Marlin/example_configurations/Infitary/i3-M508/Configuration.h
  18. 1
    1
      Marlin/example_configurations/Malyan/M150/Configuration.h
  19. 1
    1
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  20. 1
    1
      Marlin/example_configurations/RigidBot/Configuration.h
  21. 1
    1
      Marlin/example_configurations/SCARA/Configuration.h
  22. 1
    1
      Marlin/example_configurations/TinyBoy2/Configuration.h
  23. 1
    1
      Marlin/example_configurations/Velleman/K8200/Configuration.h
  24. 1
    1
      Marlin/example_configurations/Velleman/K8400/Configuration.h
  25. 1
    1
      Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h
  26. 1
    1
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  27. 1
    1
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h
  28. 1
    1
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h
  29. 1
    1
      Marlin/example_configurations/delta/generic/Configuration.h
  30. 1
    1
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  31. 1
    1
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  32. 1
    1
      Marlin/example_configurations/delta/kossel_xl/Configuration.h
  33. 1
    1
      Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h
  34. 1
    1
      Marlin/example_configurations/makibox/Configuration.h
  35. 1
    1
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  36. 1
    1
      Marlin/example_configurations/wt150/Configuration.h
  37. 3
    1
      Marlin/servo.cpp

+ 1
- 0
.travis.yml Parādīt failu

@@ -114,6 +114,7 @@ script:
114 114
   #
115 115
   - restore_configs
116 116
   - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE
117
+  - opt_set NUM_SERVOS 1
117 118
   - opt_enable AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT
118 119
   - opt_enable_adv EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET
119 120
   - build_marlin

+ 1
- 1
Marlin/Conditionals_LCD.h Parādīt failu

@@ -377,7 +377,7 @@
377 377
     #endif
378 378
     #undef DEACTIVATE_SERVOS_AFTER_MOVE
379 379
     #undef SERVO_DELAY
380
-    #define SERVO_DELAY 50
380
+    #define SERVO_DELAY { 50 }
381 381
     #ifndef BLTOUCH_DELAY
382 382
       #define BLTOUCH_DELAY 375
383 383
     #endif

+ 1
- 1
Marlin/Configuration.h Parādīt failu

@@ -1595,7 +1595,7 @@
1595 1595
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1596 1596
 // 300ms is a good value but you can try less delay.
1597 1597
 // If the servo can't reach the requested position, increase it.
1598
-#define SERVO_DELAY 300
1598
+#define SERVO_DELAY { 300 }
1599 1599
 
1600 1600
 // Servo deactivation
1601 1601
 //

+ 1
- 1
Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h Parādīt failu

@@ -1615,7 +1615,7 @@
1615 1615
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1616 1616
 // 300ms is a good value but you can try less delay.
1617 1617
 // If the servo can't reach the requested position, increase it.
1618
-#define SERVO_DELAY 300
1618
+#define SERVO_DELAY { 300 }
1619 1619
 
1620 1620
 // Servo deactivation
1621 1621
 //

+ 1
- 1
Marlin/example_configurations/AliExpress/CL-260/Configuration.h Parādīt failu

@@ -1595,7 +1595,7 @@
1595 1595
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1596 1596
 // 300ms is a good value but you can try less delay.
1597 1597
 // If the servo can't reach the requested position, increase it.
1598
-#define SERVO_DELAY 300
1598
+#define SERVO_DELAY { 300 }
1599 1599
 
1600 1600
 // Servo deactivation
1601 1601
 //

+ 1
- 1
Marlin/example_configurations/Anet/A6/Configuration.h Parādīt failu

@@ -1754,7 +1754,7 @@
1754 1754
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1755 1755
 // 300ms is a good value but you can try less delay.
1756 1756
 // If the servo can't reach the requested position, increase it.
1757
-#define SERVO_DELAY 300
1757
+#define SERVO_DELAY { 300 }
1758 1758
 
1759 1759
 // Servo deactivation
1760 1760
 //

+ 1
- 1
Marlin/example_configurations/Anet/A8/Configuration.h Parādīt failu

@@ -1603,7 +1603,7 @@
1603 1603
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1604 1604
 // 300ms is a good value but you can try less delay.
1605 1605
 // If the servo can't reach the requested position, increase it.
1606
-#define SERVO_DELAY 300
1606
+#define SERVO_DELAY { 300 }
1607 1607
 
1608 1608
 // Servo deactivation
1609 1609
 //

+ 1
- 1
Marlin/example_configurations/BQ/Hephestos/Configuration.h Parādīt failu

@@ -1586,7 +1586,7 @@
1586 1586
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1587 1587
 // 300ms is a good value but you can try less delay.
1588 1588
 // If the servo can't reach the requested position, increase it.
1589
-#define SERVO_DELAY 300
1589
+#define SERVO_DELAY { 300 }
1590 1590
 
1591 1591
 // Servo deactivation
1592 1592
 //

+ 1
- 1
Marlin/example_configurations/BQ/Hephestos_2/Configuration.h Parādīt failu

@@ -1596,7 +1596,7 @@
1596 1596
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1597 1597
 // 300ms is a good value but you can try less delay.
1598 1598
 // If the servo can't reach the requested position, increase it.
1599
-#define SERVO_DELAY 300
1599
+#define SERVO_DELAY { 300 }
1600 1600
 
1601 1601
 // Servo deactivation
1602 1602
 //

+ 1
- 1
Marlin/example_configurations/BQ/WITBOX/Configuration.h Parādīt failu

@@ -1586,7 +1586,7 @@
1586 1586
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1587 1587
 // 300ms is a good value but you can try less delay.
1588 1588
 // If the servo can't reach the requested position, increase it.
1589
-#define SERVO_DELAY 300
1589
+#define SERVO_DELAY { 300 }
1590 1590
 
1591 1591
 // Servo deactivation
1592 1592
 //

+ 1
- 1
Marlin/example_configurations/Cartesio/Configuration.h Parādīt failu

@@ -1594,7 +1594,7 @@
1594 1594
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1595 1595
 // 300ms is a good value but you can try less delay.
1596 1596
 // If the servo can't reach the requested position, increase it.
1597
-#define SERVO_DELAY 300
1597
+#define SERVO_DELAY { 300 }
1598 1598
 
1599 1599
 // Servo deactivation
1600 1600
 //

+ 1
- 1
Marlin/example_configurations/Creality/CR-10/Configuration.h Parādīt failu

@@ -1607,7 +1607,7 @@
1607 1607
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1608 1608
 // 300ms is a good value but you can try less delay.
1609 1609
 // If the servo can't reach the requested position, increase it.
1610
-#define SERVO_DELAY 300
1610
+#define SERVO_DELAY { 300 }
1611 1611
 
1612 1612
 // Servo deactivation
1613 1613
 //

+ 1
- 1
Marlin/example_configurations/Felix/Configuration.h Parādīt failu

@@ -1577,7 +1577,7 @@
1577 1577
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1578 1578
 // 300ms is a good value but you can try less delay.
1579 1579
 // If the servo can't reach the requested position, increase it.
1580
-#define SERVO_DELAY 300
1580
+#define SERVO_DELAY { 300 }
1581 1581
 
1582 1582
 // Servo deactivation
1583 1583
 //

+ 1
- 1
Marlin/example_configurations/Felix/DUAL/Configuration.h Parādīt failu

@@ -1577,7 +1577,7 @@
1577 1577
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1578 1578
 // 300ms is a good value but you can try less delay.
1579 1579
 // If the servo can't reach the requested position, increase it.
1580
-#define SERVO_DELAY 300
1580
+#define SERVO_DELAY { 300 }
1581 1581
 
1582 1582
 // Servo deactivation
1583 1583
 //

+ 1
- 1
Marlin/example_configurations/Geeetech/GT2560/Configuration.h Parādīt failu

@@ -1610,7 +1610,7 @@
1610 1610
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1611 1611
 // 300ms is a good value but you can try less delay.
1612 1612
 // If the servo can't reach the requested position, increase it.
1613
-#define SERVO_DELAY 300
1613
+#define SERVO_DELAY { 300 }
1614 1614
 
1615 1615
 // Servo deactivation
1616 1616
 //

+ 1
- 1
Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h Parādīt failu

@@ -1595,7 +1595,7 @@
1595 1595
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1596 1596
 // 300ms is a good value but you can try less delay.
1597 1597
 // If the servo can't reach the requested position, increase it.
1598
-#define SERVO_DELAY 300
1598
+#define SERVO_DELAY { 300 }
1599 1599
 
1600 1600
 // Servo deactivation
1601 1601
 //

+ 1
- 1
Marlin/example_configurations/Infitary/i3-M508/Configuration.h Parādīt failu

@@ -1599,7 +1599,7 @@
1599 1599
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1600 1600
 // 300ms is a good value but you can try less delay.
1601 1601
 // If the servo can't reach the requested position, increase it.
1602
-#define SERVO_DELAY 300
1602
+#define SERVO_DELAY { 300 }
1603 1603
 
1604 1604
 // Servo deactivation
1605 1605
 //

+ 1
- 1
Marlin/example_configurations/Malyan/M150/Configuration.h Parādīt failu

@@ -1623,7 +1623,7 @@
1623 1623
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1624 1624
 // 300ms is a good value but you can try less delay.
1625 1625
 // If the servo can't reach the requested position, increase it.
1626
-#define SERVO_DELAY 300
1626
+#define SERVO_DELAY { 300 }
1627 1627
 
1628 1628
 // Servo deactivation
1629 1629
 //

+ 1
- 1
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h Parādīt failu

@@ -1595,7 +1595,7 @@
1595 1595
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1596 1596
 // 300ms is a good value but you can try less delay.
1597 1597
 // If the servo can't reach the requested position, increase it.
1598
-#define SERVO_DELAY 300
1598
+#define SERVO_DELAY { 300 }
1599 1599
 
1600 1600
 // Servo deactivation
1601 1601
 //

+ 1
- 1
Marlin/example_configurations/RigidBot/Configuration.h Parādīt failu

@@ -1595,7 +1595,7 @@
1595 1595
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1596 1596
 // 300ms is a good value but you can try less delay.
1597 1597
 // If the servo can't reach the requested position, increase it.
1598
-#define SERVO_DELAY 300
1598
+#define SERVO_DELAY { 300 }
1599 1599
 
1600 1600
 // Servo deactivation
1601 1601
 //

+ 1
- 1
Marlin/example_configurations/SCARA/Configuration.h Parādīt failu

@@ -1607,7 +1607,7 @@
1607 1607
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1608 1608
 // 300ms is a good value but you can try less delay.
1609 1609
 // If the servo can't reach the requested position, increase it.
1610
-#define SERVO_DELAY 300
1610
+#define SERVO_DELAY { 300 }
1611 1611
 
1612 1612
 // Servo deactivation
1613 1613
 //

+ 1
- 1
Marlin/example_configurations/TinyBoy2/Configuration.h Parādīt failu

@@ -1651,7 +1651,7 @@
1651 1651
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1652 1652
 // 300ms is a good value but you can try less delay.
1653 1653
 // If the servo can't reach the requested position, increase it.
1654
-#define SERVO_DELAY 300
1654
+#define SERVO_DELAY { 300 }
1655 1655
 
1656 1656
 // Servo deactivation
1657 1657
 //

+ 1
- 1
Marlin/example_configurations/Velleman/K8200/Configuration.h Parādīt failu

@@ -1629,7 +1629,7 @@
1629 1629
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1630 1630
 // 300ms is a good value but you can try less delay.
1631 1631
 // If the servo can't reach the requested position, increase it.
1632
-#define SERVO_DELAY 300
1632
+#define SERVO_DELAY { 300 }
1633 1633
 
1634 1634
 // Servo deactivation
1635 1635
 //

+ 1
- 1
Marlin/example_configurations/Velleman/K8400/Configuration.h Parādīt failu

@@ -1595,7 +1595,7 @@
1595 1595
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1596 1596
 // 300ms is a good value but you can try less delay.
1597 1597
 // If the servo can't reach the requested position, increase it.
1598
-#define SERVO_DELAY 300
1598
+#define SERVO_DELAY { 300 }
1599 1599
 
1600 1600
 // Servo deactivation
1601 1601
 //

+ 1
- 1
Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h Parādīt failu

@@ -1595,7 +1595,7 @@
1595 1595
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1596 1596
 // 300ms is a good value but you can try less delay.
1597 1597
 // If the servo can't reach the requested position, increase it.
1598
-#define SERVO_DELAY 300
1598
+#define SERVO_DELAY { 300 }
1599 1599
 
1600 1600
 // Servo deactivation
1601 1601
 //

+ 1
- 1
Marlin/example_configurations/adafruit/ST7565/Configuration.h Parādīt failu

@@ -1595,7 +1595,7 @@
1595 1595
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1596 1596
 // 300ms is a good value but you can try less delay.
1597 1597
 // If the servo can't reach the requested position, increase it.
1598
-#define SERVO_DELAY 300
1598
+#define SERVO_DELAY { 300 }
1599 1599
 
1600 1600
 // Servo deactivation
1601 1601
 //

+ 1
- 1
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h Parādīt failu

@@ -1723,7 +1723,7 @@
1723 1723
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1724 1724
 // 300ms is a good value but you can try less delay.
1725 1725
 // If the servo can't reach the requested position, increase it.
1726
-#define SERVO_DELAY 300
1726
+#define SERVO_DELAY { 300 }
1727 1727
 
1728 1728
 // Servo deactivation
1729 1729
 //

+ 1
- 1
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h Parādīt failu

@@ -1716,7 +1716,7 @@
1716 1716
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1717 1717
 // 300ms is a good value but you can try less delay.
1718 1718
 // If the servo can't reach the requested position, increase it.
1719
-#define SERVO_DELAY 300
1719
+#define SERVO_DELAY { 300 }
1720 1720
 
1721 1721
 // Servo deactivation
1722 1722
 //

+ 1
- 1
Marlin/example_configurations/delta/generic/Configuration.h Parādīt failu

@@ -1711,7 +1711,7 @@
1711 1711
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1712 1712
 // 300ms is a good value but you can try less delay.
1713 1713
 // If the servo can't reach the requested position, increase it.
1714
-#define SERVO_DELAY 300
1714
+#define SERVO_DELAY { 300 }
1715 1715
 
1716 1716
 // Servo deactivation
1717 1717
 //

+ 1
- 1
Marlin/example_configurations/delta/kossel_mini/Configuration.h Parādīt failu

@@ -1714,7 +1714,7 @@
1714 1714
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1715 1715
 // 300ms is a good value but you can try less delay.
1716 1716
 // If the servo can't reach the requested position, increase it.
1717
-#define SERVO_DELAY 300
1717
+#define SERVO_DELAY { 300 }
1718 1718
 
1719 1719
 // Servo deactivation
1720 1720
 //

+ 1
- 1
Marlin/example_configurations/delta/kossel_pro/Configuration.h Parādīt failu

@@ -1714,7 +1714,7 @@
1714 1714
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1715 1715
 // 300ms is a good value but you can try less delay.
1716 1716
 // If the servo can't reach the requested position, increase it.
1717
-#define SERVO_DELAY 300
1717
+#define SERVO_DELAY { 300 }
1718 1718
 
1719 1719
 // Servo deactivation
1720 1720
 //

+ 1
- 1
Marlin/example_configurations/delta/kossel_xl/Configuration.h Parādīt failu

@@ -1723,7 +1723,7 @@
1723 1723
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1724 1724
 // 300ms is a good value but you can try less delay.
1725 1725
 // If the servo can't reach the requested position, increase it.
1726
-#define SERVO_DELAY 300
1726
+#define SERVO_DELAY { 300 }
1727 1727
 
1728 1728
 // Servo deactivation
1729 1729
 //

+ 1
- 1
Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h Parādīt failu

@@ -1609,7 +1609,7 @@
1609 1609
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1610 1610
 // 300ms is a good value but you can try less delay.
1611 1611
 // If the servo can't reach the requested position, increase it.
1612
-#define SERVO_DELAY 300
1612
+#define SERVO_DELAY { 300 }
1613 1613
 
1614 1614
 // Servo deactivation
1615 1615
 //

+ 1
- 1
Marlin/example_configurations/makibox/Configuration.h Parādīt failu

@@ -1598,7 +1598,7 @@
1598 1598
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1599 1599
 // 300ms is a good value but you can try less delay.
1600 1600
 // If the servo can't reach the requested position, increase it.
1601
-#define SERVO_DELAY 300
1601
+#define SERVO_DELAY { 300 }
1602 1602
 
1603 1603
 // Servo deactivation
1604 1604
 //

+ 1
- 1
Marlin/example_configurations/tvrrug/Round2/Configuration.h Parādīt failu

@@ -1590,7 +1590,7 @@
1590 1590
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1591 1591
 // 300ms is a good value but you can try less delay.
1592 1592
 // If the servo can't reach the requested position, increase it.
1593
-#define SERVO_DELAY 300
1593
+#define SERVO_DELAY { 300 }
1594 1594
 
1595 1595
 // Servo deactivation
1596 1596
 //

+ 1
- 1
Marlin/example_configurations/wt150/Configuration.h Parādīt failu

@@ -1600,7 +1600,7 @@
1600 1600
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
1601 1601
 // 300ms is a good value but you can try less delay.
1602 1602
 // If the servo can't reach the requested position, increase it.
1603
-#define SERVO_DELAY 300
1603
+#define SERVO_DELAY { 300 }
1604 1604
 
1605 1605
 // Servo deactivation
1606 1606
 //

+ 3
- 1
Marlin/servo.cpp Parādīt failu

@@ -308,9 +308,11 @@ int Servo::readMicroseconds() {
308 308
 bool Servo::attached() { return servo_info[this->servoIndex].Pin.isActive; }
309 309
 
310 310
 void Servo::move(int value) {
311
+  constexpr uint16_t servo_delay[] = SERVO_DELAY;
312
+  static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long.");
311 313
   if (this->attach(0) >= 0) {
312 314
     this->write(value);
313
-    delay(SERVO_DELAY);
315
+    delay(servo_delay[this->servoIndex]);
314 316
     #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
315 317
       this->detach();
316 318
     #endif

Notiek ielāde…
Atcelt
Saglabāt