summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkliment <kliment.yanev@gmail.com>2011-07-09 15:12:33 +0200
committerkliment <kliment.yanev@gmail.com>2011-07-09 15:12:33 +0200
commit469e53475a04cab77d5ab4ce787f70ea580b67b9 (patch)
treee8b212613b5419a98aa6cfef67ee6ae6677a8ef8
parent75edff00c497798a07520e4be9af334e8b38c4e0 (diff)
Use fastio for endstop checks during moves
-rw-r--r--Sprinter/Sprinter.pde24
1 files changed, 18 insertions, 6 deletions
diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde
index b79a329..ae07730 100644
--- a/Sprinter/Sprinter.pde
+++ b/Sprinter/Sprinter.pde
@@ -1197,12 +1197,24 @@ void linear_move(unsigned long axis_steps_remaining[]) // make linear move with
//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(digitalRead(X_MIN_PIN) != ENDSTOPS_INVERTING) break;
- if(Y_MIN_PIN > -1) if(!move_direction[1]) if(digitalRead(Y_MIN_PIN) != ENDSTOPS_INVERTING) break;
- if(X_MAX_PIN > -1) if(move_direction[0]) if(digitalRead(X_MAX_PIN) != ENDSTOPS_INVERTING) break;
- if(Y_MAX_PIN > -1) if(move_direction[1]) if(digitalRead(Y_MAX_PIN) != ENDSTOPS_INVERTING) break;
- if(Z_MIN_PIN > -1) if(!move_direction[2]) if(digitalRead(Z_MIN_PIN) != ENDSTOPS_INVERTING) break;
- if(Z_MAX_PIN > -1) if(move_direction[2]) if(digitalRead(Z_MAX_PIN) != ENDSTOPS_INVERTING) break;
+ #if (X_MIN_PIN > -1)
+ if(!move_direction[0]) if(READ(X_MIN_PIN) != ENDSTOPS_INVERTING) break;
+ #endif
+ #if (Y_MIN_PIN > -1)
+ if(!move_direction[1]) if(READ(Y_MIN_PIN) != ENDSTOPS_INVERTING) break;
+ #endif
+ #if (X_MAX_PIN > -1)
+ if(move_direction[0]) if(READ(X_MAX_PIN) != ENDSTOPS_INVERTING) break;
+ #endif
+ #if (Y_MAX_PIN > -1)
+ if(move_direction[1]) if(READ(Y_MAX_PIN) != ENDSTOPS_INVERTING) break;
+ #endif
+ #if (Z_MIN_PIN > -1)
+ if(!move_direction[2]) if(READ(Z_MIN_PIN) != ENDSTOPS_INVERTING) break;
+ #endif
+ #if (Z_MAX_PIN > -1)
+ if(move_direction[2]) if(READ(Z_MAX_PIN) != ENDSTOPS_INVERTING) break;
+ #endif
timediff = micros() * 100 - axis_previous_micros[primary_axis];
if(timediff<0){//check for overflow
axis_previous_micros[primary_axis]=micros()*100;