Browse Source

Use some int types in Planner

Scott Lahteine 7 years ago
parent
commit
d3f8111fe7
2 changed files with 10 additions and 10 deletions
  1. 9
    9
      Marlin/planner.cpp
  2. 1
    1
      Marlin/planner.h

+ 9
- 9
Marlin/planner.cpp View File

133
 
133
 
134
 // private:
134
 // private:
135
 
135
 
136
-long Planner::position[NUM_AXIS] = { 0 };
136
+int32_t Planner::position[NUM_AXIS] = { 0 };
137
 
137
 
138
 uint32_t Planner::cutoff_long;
138
 uint32_t Planner::cutoff_long;
139
 
139
 
675
     }
675
     }
676
   #endif
676
   #endif
677
 
677
 
678
-  const long da = target[X_AXIS] - position[X_AXIS],
679
-             db = target[Y_AXIS] - position[Y_AXIS],
680
-             dc = target[Z_AXIS] - position[Z_AXIS];
678
+  const int32_t da = target[X_AXIS] - position[X_AXIS],
679
+                db = target[Y_AXIS] - position[Y_AXIS],
680
+                dc = target[Z_AXIS] - position[Z_AXIS];
681
 
681
 
682
   /*
682
   /*
683
   SERIAL_ECHOPAIR("  Planner FR:", fr_mm_s);
683
   SERIAL_ECHOPAIR("  Planner FR:", fr_mm_s);
706
   if (DEBUGGING(DRYRUN))
706
   if (DEBUGGING(DRYRUN))
707
     position[E_AXIS] = target[E_AXIS];
707
     position[E_AXIS] = target[E_AXIS];
708
 
708
 
709
-  long de = target[E_AXIS] - position[E_AXIS];
709
+  int32_t de = target[E_AXIS] - position[E_AXIS];
710
 
710
 
711
   #if ENABLED(PREVENT_COLD_EXTRUSION) || ENABLED(PREVENT_LENGTHY_EXTRUDE)
711
   #if ENABLED(PREVENT_COLD_EXTRUSION) || ENABLED(PREVENT_LENGTHY_EXTRUDE)
712
     if (de) {
712
     if (de) {
1386
   #else
1386
   #else
1387
     #define _EINDEX E_AXIS
1387
     #define _EINDEX E_AXIS
1388
   #endif
1388
   #endif
1389
-  const long na = position[X_AXIS] = LROUND(a * axis_steps_per_mm[X_AXIS]),
1390
-             nb = position[Y_AXIS] = LROUND(b * axis_steps_per_mm[Y_AXIS]),
1391
-             nc = position[Z_AXIS] = LROUND(c * axis_steps_per_mm[Z_AXIS]),
1392
-             ne = position[E_AXIS] = LROUND(e * axis_steps_per_mm[_EINDEX]);
1389
+  const int32_t na = position[X_AXIS] = LROUND(a * axis_steps_per_mm[X_AXIS]),
1390
+                nb = position[Y_AXIS] = LROUND(b * axis_steps_per_mm[Y_AXIS]),
1391
+                nc = position[Z_AXIS] = LROUND(c * axis_steps_per_mm[Z_AXIS]),
1392
+                ne = position[E_AXIS] = LROUND(e * axis_steps_per_mm[_EINDEX]);
1393
   stepper.set_position(na, nb, nc, ne);
1393
   stepper.set_position(na, nb, nc, ne);
1394
   previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest.
1394
   previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest.
1395
   ZERO(previous_speed);
1395
   ZERO(previous_speed);

+ 1
- 1
Marlin/planner.h View File

182
      * The current position of the tool in absolute steps
182
      * The current position of the tool in absolute steps
183
      * Recalculated if any axis_steps_per_mm are changed by gcode
183
      * Recalculated if any axis_steps_per_mm are changed by gcode
184
      */
184
      */
185
-    static long position[NUM_AXIS];
185
+    static int32_t position[NUM_AXIS];
186
 
186
 
187
     /**
187
     /**
188
      * Speed of previous path line segment
188
      * Speed of previous path line segment

Loading…
Cancel
Save