Skip to content

Commit

Permalink
Merge branch 'Marlin_v1' of https://github.com/ErikZalm/Marlin into M…
Browse files Browse the repository at this point in the history
…arlin_v1
  • Loading branch information
bkubicek committed Nov 19, 2011
2 parents 61e0740 + 0e7fee9 commit d41547a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Marlin/Marlin.pde
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,18 @@ inline void get_arc_coordinates()

void prepare_move()
{
if (min_software_endstops) {
if (destination[X_AXIS] < 0) destination[X_AXIS] = 0.0;
if (destination[Y_AXIS] < 0) destination[Y_AXIS] = 0.0;
if (destination[Z_AXIS] < 0) destination[Z_AXIS] = 0.0;
}

if (max_software_endstops) {
if (destination[X_AXIS] > X_MAX_LENGTH) destination[X_AXIS] = X_MAX_LENGTH;
if (destination[Y_AXIS] > Y_MAX_LENGTH) destination[Y_AXIS] = Y_MAX_LENGTH;
if (destination[Z_AXIS] > Z_MAX_LENGTH) destination[Z_AXIS] = Z_MAX_LENGTH;
}

plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0);
for(int8_t i=0; i < NUM_AXIS; i++) {
current_position[i] = destination[i];
Expand Down
2 changes: 1 addition & 1 deletion Marlin/planner.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
typedef struct {
// Fields used by the bresenham algorithm for tracing the line
long steps_x, steps_y, steps_z, steps_e; // Step count along each axis
long step_event_count; // The number of step events required to complete this block
unsigned long step_event_count; // The number of step events required to complete this block
long accelerate_until; // The index of the step event on which to stop acceleration
long decelerate_after; // The index of the step event on which to start decelerating
long acceleration_rate; // The acceleration rate used for acceleration calculation
Expand Down

0 comments on commit d41547a

Please sign in to comment.