summaryrefslogtreecommitdiff
path: root/Sprinter
diff options
context:
space:
mode:
authorkliment <kliment.yanev@gmail.com>2011-07-10 11:10:45 +0200
committerkliment <kliment.yanev@gmail.com>2011-07-10 11:10:45 +0200
commitc669e0bc0a721e4c81291704aa8ff11548bd151c (patch)
tree5dbc1beb14017af4666b771f16f6450a5ecd49f0 /Sprinter
parent19ae7c56b6a2f65cea495f31b469031695466de3 (diff)
Attempt to complete move if non-primary axis endstop hit, otherwise abort move and save position
Diffstat (limited to 'Sprinter')
-rw-r--r--Sprinter/Sprinter.pde12
1 files changed, 6 insertions, 6 deletions
diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde
index 31d00df..095bfc3 100644
--- a/Sprinter/Sprinter.pde
+++ b/Sprinter/Sprinter.pde
@@ -1225,22 +1225,22 @@ inline void linear_move(unsigned long axis_steps_remaining[]) // make linear mov
//If there are x or y steps remaining, perform Bresenham algorithm
if(axis_steps_remaining[primary_axis]) {
#if (X_MIN_PIN > -1)
- if(!move_direction[0]) if(READ(X_MIN_PIN) != ENDSTOPS_INVERTING) break;
+ if(!move_direction[0]) if(READ(X_MIN_PIN) != ENDSTOPS_INVERTING) if(primary_axis==0) break; else if(axis_step_remaining[0]) axis_step_remaining[0]=0;
#endif
#if (Y_MIN_PIN > -1)
- if(!move_direction[1]) if(READ(Y_MIN_PIN) != ENDSTOPS_INVERTING) break;
+ if(!move_direction[1]) if(READ(Y_MIN_PIN) != ENDSTOPS_INVERTING) if(primary_axis==1) break; else if(axis_step_remaining[1]) axis_step_remaining[1]=0;
#endif
#if (X_MAX_PIN > -1)
- if(move_direction[0]) if(READ(X_MAX_PIN) != ENDSTOPS_INVERTING) break;
+ if(move_direction[0]) if(READ(X_MAX_PIN) != ENDSTOPS_INVERTING) if(primary_axis==0) break; else if(axis_step_remaining[0]) axis_step_remaining[0]=0;
#endif
#if (Y_MAX_PIN > -1)
- if(move_direction[1]) if(READ(Y_MAX_PIN) != ENDSTOPS_INVERTING) break;
+ if(move_direction[1]) if(READ(Y_MAX_PIN) != ENDSTOPS_INVERTING) if(primary_axis==1) break; else if(axis_step_remaining[1]) axis_step_remaining[1]=0;
#endif
#if (Z_MIN_PIN > -1)
- if(!move_direction[2]) if(READ(Z_MIN_PIN) != ENDSTOPS_INVERTING) break;
+ if(!move_direction[2]) if(READ(Z_MIN_PIN) != ENDSTOPS_INVERTING) if(primary_axis==2) break; else if(axis_step_remaining[2]) axis_step_remaining[2]=0;
#endif
#if (Z_MAX_PIN > -1)
- if(move_direction[2]) if(READ(Z_MAX_PIN) != ENDSTOPS_INVERTING) break;
+ if(move_direction[2]) if(READ(Z_MAX_PIN) != ENDSTOPS_INVERTING) if(primary_axis==2) break; else if(axis_step_remaining[2]) axis_step_remaining[2]=0;
#endif
timediff = micros() * 100 - axis_previous_micros[primary_axis];
if(timediff<0){//check for overflow