diff options
Diffstat (limited to 'Sprinter')
-rw-r--r-- | Sprinter/Sprinter.pde | 25 |
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. |