Browse Source

Merge pull request #532 from codexmas/ServoEndstops

Fix for ugly code compilation errors in SERVO_ENDSTOP checks
daid 11 years ago
parent
commit
d77f5ee722
1 changed files with 9 additions and 5 deletions
  1. 9
    5
      Marlin/Marlin_main.cpp

+ 9
- 5
Marlin/Marlin_main.cpp View File

687
       0) {
687
       0) {
688
 
688
 
689
     // Engage Servo endstop if enabled
689
     // Engage Servo endstop if enabled
690
-    #ifdef SERVO_ENDSTOPS[axis] > -1
691
-      servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]);
690
+    #ifdef SERVO_ENDSTOPS
691
+      if (SERVO_ENDSTOPS[axis] > -1) {
692
+        servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]);
693
+      }
692
     #endif
694
     #endif
693
-
695
+      
694
     current_position[axis] = 0;
696
     current_position[axis] = 0;
695
     plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
697
     plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
696
     destination[axis] = 1.5 * max_length(axis) * home_dir(axis);
698
     destination[axis] = 1.5 * max_length(axis) * home_dir(axis);
715
     endstops_hit_on_purpose();
717
     endstops_hit_on_purpose();
716
 
718
 
717
     // Retract Servo endstop if enabled
719
     // Retract Servo endstop if enabled
718
-    #ifdef SERVO_ENDSTOPS[axis] > -1
719
-      servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2 + 1]);
720
+    #ifdef SERVO_ENDSTOPS
721
+      if (SERVO_ENDSTOPS[axis] > -1) {
722
+        servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2 + 1]);
723
+      }
720
     #endif
724
     #endif
721
   }
725
   }
722
 }
726
 }

Loading…
Cancel
Save