summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkliment <kliment.yanev@gmail.com>2011-07-09 15:03:49 +0200
committerkliment <kliment.yanev@gmail.com>2011-07-09 15:03:49 +0200
commit75edff00c497798a07520e4be9af334e8b38c4e0 (patch)
tree9b39b907d7cc164c9ed5c4cd87afc8d5dac09a34
parent8cfb01ae757bc9f2340993ac11048af6b1e43f9d (diff)
Use fastio for endstop check at start of move
-rw-r--r--Sprinter/Sprinter.pde25
1 files changed, 19 insertions, 6 deletions
diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde
index c8f05f3..b79a329 100644
--- a/Sprinter/Sprinter.pde
+++ b/Sprinter/Sprinter.pde
@@ -1009,12 +1009,25 @@ void linear_move(unsigned long axis_steps_remaining[]) // make linear move with
else WRITE(Z_DIR_PIN,INVERT_Z_DIR);
if (destination[3] > current_position[3]) WRITE(E_DIR_PIN,!INVERT_E_DIR);
else WRITE(E_DIR_PIN,INVERT_E_DIR);
- if(X_MIN_PIN > -1) if(!move_direction[0]) if(digitalRead(X_MIN_PIN) != ENDSTOPS_INVERTING) axis_steps_remaining[0]=0;
- if(Y_MIN_PIN > -1) if(!move_direction[1]) if(digitalRead(Y_MIN_PIN) != ENDSTOPS_INVERTING) axis_steps_remaining[1]=0;
- if(Z_MIN_PIN > -1) if(!move_direction[2]) if(digitalRead(Z_MIN_PIN) != ENDSTOPS_INVERTING) axis_steps_remaining[2]=0;
- if(X_MAX_PIN > -1) if(move_direction[0]) if(digitalRead(X_MAX_PIN) != ENDSTOPS_INVERTING) axis_steps_remaining[0]=0;
- if(Y_MAX_PIN > -1) if(move_direction[1]) if(digitalRead(Y_MAX_PIN) != ENDSTOPS_INVERTING) axis_steps_remaining[1]=0;
- if(Z_MAX_PIN > -1) if(move_direction[2]) if(digitalRead(Z_MAX_PIN) != ENDSTOPS_INVERTING) axis_steps_remaining[2]=0;
+ movereset:
+ #if (X_MIN_PIN > -1)
+ if(!move_direction[0]) if(READ(X_MIN_PIN) != ENDSTOPS_INVERTING) axis_steps_remaining[0]=0;
+ #endif
+ #if (Y_MIN_PIN > -1)
+ if(!move_direction[1]) if(READ(Y_MIN_PIN) != ENDSTOPS_INVERTING) axis_steps_remaining[1]=0;
+ #endif
+ #if (Z_MIN_PIN > -1)
+ if(!move_direction[2]) if(READ(Z_MIN_PIN) != ENDSTOPS_INVERTING) axis_steps_remaining[2]=0;
+ #endif
+ #if (X_MAX_PIN > -1)
+ if(move_direction[0]) if(READ(X_MAX_PIN) != ENDSTOPS_INVERTING) axis_steps_remaining[0]=0;
+ #endif
+ #if (Y_MAX_PIN > -1)
+ if(move_direction[1]) if(READ(Y_MAX_PIN) != ENDSTOPS_INVERTING) axis_steps_remaining[1]=0;
+ #endif
+ # if(Z_MAX_PIN > -1)
+ if(move_direction[2]) if(READ(Z_MAX_PIN) != ENDSTOPS_INVERTING) axis_steps_remaining[2]=0;
+ #endif
//Only enable axis that are moving. If the axis doesn't need to move then it can stay disabled depending on configuration.