Merge pull request #532 from codexmas/ServoEndstops

Fix for ugly code compilation errors in SERVO_ENDSTOP checks
master
daid 12 years ago
commit d77f5ee722

@ -687,10 +687,12 @@ static void homeaxis(int axis) {
0) { 0) {
// Engage Servo endstop if enabled // Engage Servo endstop if enabled
#ifdef SERVO_ENDSTOPS[axis] > -1 #ifdef SERVO_ENDSTOPS
servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]); if (SERVO_ENDSTOPS[axis] > -1) {
servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]);
}
#endif #endif
current_position[axis] = 0; current_position[axis] = 0;
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
destination[axis] = 1.5 * max_length(axis) * home_dir(axis); destination[axis] = 1.5 * max_length(axis) * home_dir(axis);
@ -715,8 +717,10 @@ static void homeaxis(int axis) {
endstops_hit_on_purpose(); endstops_hit_on_purpose();
// Retract Servo endstop if enabled // Retract Servo endstop if enabled
#ifdef SERVO_ENDSTOPS[axis] > -1 #ifdef SERVO_ENDSTOPS
servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2 + 1]); if (SERVO_ENDSTOPS[axis] > -1) {
servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2 + 1]);
}
#endif #endif
} }
} }

Loading…
Cancel
Save