Browse Source

Servos attach/detach based only on servo config

Assuming #2470 fixed up the main issue.
Scott Lahteine 10 years ago
parent
commit
96ace72ddc
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      Marlin/servo.cpp

+ 2
- 2
Marlin/servo.cpp View File

306
 
306
 
307
 int8_t Servo::move(int pin, int value) {
307
 int8_t Servo::move(int pin, int value) {
308
   int8_t ret;
308
   int8_t ret;
309
-  #if SERVO_LEVELING
309
+  #if defined(DEACTIVATE_SERVOS_AFTER_MOVE) && (SERVO_DEACTIVATION_DELAY > 0)
310
     ret = this->attach(pin);
310
     ret = this->attach(pin);
311
   #else
311
   #else
312
     ret = this->servoIndex;
312
     ret = this->servoIndex;
313
   #endif
313
   #endif
314
   if (ret >= 0) {
314
   if (ret >= 0) {
315
     this->write(value);
315
     this->write(value);
316
-    #if SERVO_LEVELING
316
+    #if defined(DEACTIVATE_SERVOS_AFTER_MOVE) && (SERVO_DEACTIVATION_DELAY > 0)
317
       delay(SERVO_DEACTIVATION_DELAY);
317
       delay(SERVO_DEACTIVATION_DELAY);
318
       this->detach();
318
       this->detach();
319
     #endif
319
     #endif

Loading…
Cancel
Save