diff options
author | Kliment Yanev <kliment.yanev@gmail.com> | 2011-09-03 18:52:18 +0200 |
---|---|---|
committer | Kliment Yanev <kliment.yanev@gmail.com> | 2011-09-03 18:52:18 +0200 |
commit | 699a41290fa8ae0e8da3c3a6d229578c849a67bc (patch) | |
tree | 3d97460f17dcf16c9e86424deffb98d65ea09312 | |
parent | 55606f1bdc264a7b4b6b5e3f83867069d9538396 (diff) |
Fix underflow in steps per square second
-rw-r--r-- | Sprinter/Sprinter.pde | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde index dde302c..eb354e1 100644 --- a/Sprinter/Sprinter.pde +++ b/Sprinter/Sprinter.pde @@ -1199,8 +1199,8 @@ inline void linear_move(unsigned long axis_steps_remaining[]) // make linear mov if (acceleration_enabled && steps_done == 0) { interval = max_interval; } else if (acceleration_enabled && steps_done <= plateau_steps) { - long current_speed = (long) ((((long) steps_per_sqr_second) / 10000) - * ((micros() - start_move_micros) / 100) + (long) min_speed_steps_per_second); + long current_speed = (long) ((((long) steps_per_sqr_second) / 100) + * ((micros() - start_move_micros) / 100)/100 + (long) min_speed_steps_per_second); interval = 100000000 / current_speed; if (interval < full_interval) { accelerating = false; |