summaryrefslogtreecommitdiff
path: root/Sprinter
diff options
context:
space:
mode:
authorkliment <kliment.yanev@gmail.com>2011-07-15 21:06:45 +0200
committerkliment <kliment.yanev@gmail.com>2011-07-15 21:06:45 +0200
commit57f4c09d1783569609c4116d260978f5e47eb049 (patch)
treebe88fe457704f122fdeee735af0e6cda1d0626cc /Sprinter
parentb31c7a837ff5baff89043f3c06b1b2191ed9f79d (diff)
Revert "Remove float conversions from step loop"
This reverts commit b31c7a837ff5baff89043f3c06b1b2191ed9f79d.
Diffstat (limited to 'Sprinter')
-rw-r--r--Sprinter/Sprinter.pde12
1 files changed, 6 insertions, 6 deletions
diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde
index 4d7aa53..8bb68d7 100644
--- a/Sprinter/Sprinter.pde
+++ b/Sprinter/Sprinter.pde
@@ -1170,10 +1170,8 @@ inline void linear_move(unsigned long axis_steps_remaining[]) // make linear mov
#ifdef DEBUG_MOVE_TIME
unsigned long startmove = micros();
#endif
- long long_steps_per_sqr_second=(long) steps_per_sqr_second;
- long long_min_speed_steps_per_second=(long) min_speed_steps_per_second;
- long long_max_speed_steps_per_second=(long) max_speed_steps_per_second;
- //move until no more steps remain THERE SHOULD BE NO FLOAT CALCS INSIDE THIS LOOP
+
+ //move until no more steps remain
while(axis_steps_remaining[0] + axis_steps_remaining[1] + axis_steps_remaining[2] + axis_steps_remaining[3] > 0) {
#ifdef DISABLE_CHECK_DURING_ACC
if(!accelerating && !decelerating) {
@@ -1199,7 +1197,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_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) / 10000)
+ * ((micros() - start_move_micros) / 100) + (long) min_speed_steps_per_second);
interval = 100000000 / current_speed;
if (interval < full_interval) {
accelerating = false;
@@ -1216,7 +1215,8 @@ inline void linear_move(unsigned long axis_steps_remaining[]) // make linear mov
accelerating = true;
decelerating = true;
}
- long current_speed = long_max_speed_steps_per_second - (((long_steps_per_sqr_second / 10000) * ((micros() - start_move_micros) / 100)));
+ long current_speed = (long) ((long) max_speed_steps_per_second - ((((long) steps_per_sqr_second) / 10000)
+ * ((micros() - start_move_micros) / 100)));
interval = 100000000 / current_speed;
if (interval > max_interval)
interval = max_interval;