Use some int types in Planner

This commit is contained in:
Scott Lahteine 2017-11-30 17:41:30 -06:00
parent ab43113f73
commit d3f8111fe7
2 changed files with 10 additions and 10 deletions

View File

@ -133,7 +133,7 @@ float Planner::min_feedrate_mm_s,
// private:
long Planner::position[NUM_AXIS] = { 0 };
int32_t Planner::position[NUM_AXIS] = { 0 };
uint32_t Planner::cutoff_long;
@ -675,7 +675,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
}
#endif
const long da = target[X_AXIS] - position[X_AXIS],
const int32_t da = target[X_AXIS] - position[X_AXIS],
db = target[Y_AXIS] - position[Y_AXIS],
dc = target[Z_AXIS] - position[Z_AXIS];
@ -706,7 +706,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
if (DEBUGGING(DRYRUN))
position[E_AXIS] = target[E_AXIS];
long de = target[E_AXIS] - position[E_AXIS];
int32_t de = target[E_AXIS] - position[E_AXIS];
#if ENABLED(PREVENT_COLD_EXTRUSION) || ENABLED(PREVENT_LENGTHY_EXTRUDE)
if (de) {
@ -1386,7 +1386,7 @@ void Planner::_set_position_mm(const float &a, const float &b, const float &c, c
#else
#define _EINDEX E_AXIS
#endif
const long na = position[X_AXIS] = LROUND(a * axis_steps_per_mm[X_AXIS]),
const int32_t na = position[X_AXIS] = LROUND(a * axis_steps_per_mm[X_AXIS]),
nb = position[Y_AXIS] = LROUND(b * axis_steps_per_mm[Y_AXIS]),
nc = position[Z_AXIS] = LROUND(c * axis_steps_per_mm[Z_AXIS]),
ne = position[E_AXIS] = LROUND(e * axis_steps_per_mm[_EINDEX]);

View File

@ -182,7 +182,7 @@ class Planner {
* The current position of the tool in absolute steps
* Recalculated if any axis_steps_per_mm are changed by gcode
*/
static long position[NUM_AXIS];
static int32_t position[NUM_AXIS];
/**
* Speed of previous path line segment