Browse Source

Implement SERVO_DELAY as array

This modify give SERVO_DELAY x servo basis
pull/1/head
GMagician 7 years ago
committed by Scott Lahteine
parent
commit
e9c72978c7
  1. 1
      .travis.yml
  2. 2
      Marlin/Conditionals_LCD.h
  3. 2
      Marlin/Configuration.h
  4. 2
      Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h
  5. 2
      Marlin/example_configurations/AliExpress/CL-260/Configuration.h
  6. 2
      Marlin/example_configurations/Anet/A6/Configuration.h
  7. 2
      Marlin/example_configurations/Anet/A8/Configuration.h
  8. 2
      Marlin/example_configurations/BQ/Hephestos/Configuration.h
  9. 2
      Marlin/example_configurations/BQ/Hephestos_2/Configuration.h
  10. 2
      Marlin/example_configurations/BQ/WITBOX/Configuration.h
  11. 2
      Marlin/example_configurations/Cartesio/Configuration.h
  12. 2
      Marlin/example_configurations/Creality/CR-10/Configuration.h
  13. 2
      Marlin/example_configurations/Felix/Configuration.h
  14. 2
      Marlin/example_configurations/Felix/DUAL/Configuration.h
  15. 2
      Marlin/example_configurations/Geeetech/GT2560/Configuration.h
  16. 2
      Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h
  17. 2
      Marlin/example_configurations/Infitary/i3-M508/Configuration.h
  18. 2
      Marlin/example_configurations/Malyan/M150/Configuration.h
  19. 2
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  20. 2
      Marlin/example_configurations/RigidBot/Configuration.h
  21. 2
      Marlin/example_configurations/SCARA/Configuration.h
  22. 2
      Marlin/example_configurations/TinyBoy2/Configuration.h
  23. 2
      Marlin/example_configurations/Velleman/K8200/Configuration.h
  24. 2
      Marlin/example_configurations/Velleman/K8400/Configuration.h
  25. 2
      Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h
  26. 2
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  27. 2
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h
  28. 2
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h
  29. 2
      Marlin/example_configurations/delta/generic/Configuration.h
  30. 2
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  31. 2
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  32. 2
      Marlin/example_configurations/delta/kossel_xl/Configuration.h
  33. 2
      Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h
  34. 2
      Marlin/example_configurations/makibox/Configuration.h
  35. 2
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  36. 2
      Marlin/example_configurations/wt150/Configuration.h
  37. 4
      Marlin/servo.cpp

1
.travis.yml

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

2
Marlin/Conditionals_LCD.h

@ -377,7 +377,7 @@
#endif
#undef DEACTIVATE_SERVOS_AFTER_MOVE
#undef SERVO_DELAY
#define SERVO_DELAY 50
#define SERVO_DELAY { 50 }
#ifndef BLTOUCH_DELAY
#define BLTOUCH_DELAY 375
#endif

2
Marlin/Configuration.h

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

2
Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h

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

2
Marlin/example_configurations/AliExpress/CL-260/Configuration.h

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

2
Marlin/example_configurations/Anet/A6/Configuration.h

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

2
Marlin/example_configurations/Anet/A8/Configuration.h

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

2
Marlin/example_configurations/BQ/Hephestos/Configuration.h

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

2
Marlin/example_configurations/BQ/Hephestos_2/Configuration.h

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

2
Marlin/example_configurations/BQ/WITBOX/Configuration.h

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

2
Marlin/example_configurations/Cartesio/Configuration.h

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

2
Marlin/example_configurations/Creality/CR-10/Configuration.h

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

2
Marlin/example_configurations/Felix/Configuration.h

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

2
Marlin/example_configurations/Felix/DUAL/Configuration.h

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

2
Marlin/example_configurations/Geeetech/GT2560/Configuration.h

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

2
Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h

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

2
Marlin/example_configurations/Infitary/i3-M508/Configuration.h

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

2
Marlin/example_configurations/Malyan/M150/Configuration.h

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

2
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h

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

2
Marlin/example_configurations/RigidBot/Configuration.h

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

2
Marlin/example_configurations/SCARA/Configuration.h

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

2
Marlin/example_configurations/TinyBoy2/Configuration.h

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

2
Marlin/example_configurations/Velleman/K8200/Configuration.h

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

2
Marlin/example_configurations/Velleman/K8400/Configuration.h

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

2
Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h

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

2
Marlin/example_configurations/adafruit/ST7565/Configuration.h

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

2
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h

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

2
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h

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

2
Marlin/example_configurations/delta/generic/Configuration.h

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

2
Marlin/example_configurations/delta/kossel_mini/Configuration.h

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

2
Marlin/example_configurations/delta/kossel_pro/Configuration.h

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

2
Marlin/example_configurations/delta/kossel_xl/Configuration.h

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

2
Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h

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

2
Marlin/example_configurations/makibox/Configuration.h

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

2
Marlin/example_configurations/tvrrug/Round2/Configuration.h

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

2
Marlin/example_configurations/wt150/Configuration.h

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

4
Marlin/servo.cpp

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

Loading…
Cancel
Save