Skip to content

Commit

Permalink
Fixed bug which in some cases caused the moves to be done at full spe…
Browse files Browse the repository at this point in the history
…ed without acceleration
  • Loading branch information
caru committed Jul 24, 2011
1 parent 33edcb5 commit f712ec8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sprinter/Sprinter.pde
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ inline void linear_move(unsigned long axis_steps_remaining[]) // make linear mov
if(axis_steps_remaining[i] >0) {
// multiplying slowest_start_axis_max_interval by axis_steps_remaining[slowest_start_axis]
// could lead to overflows when we have long distance moves (say, 390625*390625 > sizeof(unsigned long))
float steps_remaining_ratio = axis_steps_remaining[slowest_start_axis] / axis_steps_remaining[i];
float steps_remaining_ratio = (float) axis_steps_remaining[slowest_start_axis] / axis_steps_remaining[i];
new_axis_max_intervals[i] = slowest_start_axis_max_interval * steps_remaining_ratio;

if(i == primary_axis) {
Expand Down

0 comments on commit f712ec8

Please sign in to comment.