current_position not static

This commit is contained in:
Scott Lahteine 2015-04-08 01:05:39 -07:00
parent 27cb90da8b
commit 3162971cd6
2 changed files with 7 additions and 9 deletions

View File

@ -205,7 +205,7 @@
bool Running = true;
static float feedrate = 1500.0, next_feedrate, saved_feedrate;
static float current_position[NUM_AXIS] = { 0.0 };
float current_position[NUM_AXIS] = { 0.0 };
static float destination[NUM_AXIS] = { 0.0 };
bool axis_known_position[3] = { false };

View File

@ -87,7 +87,7 @@ unsigned long axis_steps_per_sqr_second[NUM_AXIS];
0.0, 1.0, 0.0,
0.0, 0.0, 1.0
};
#endif // #ifdef ENABLE_AUTO_BED_LEVELING
#endif // ENABLE_AUTO_BED_LEVELING
// The current position of the tool in absolute steps
long position[NUM_AXIS]; //rescaled from extern when axis_steps_per_unit are changed by gcode
@ -472,7 +472,7 @@ float junction_deviation = 0.1;
void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate, const uint8_t &extruder)
#else
void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder)
#endif //ENABLE_AUTO_BED_LEVELING
#endif // ENABLE_AUTO_BED_LEVELING
{
// Calculate the buffer head after we push this byte
int next_buffer_head = next_block_index(block_buffer_head);
@ -487,9 +487,7 @@ float junction_deviation = 0.1;
#ifdef MESH_BED_LEVELING
if (mbl.active) z += mbl.get_z(x, y);
#endif
#ifdef ENABLE_AUTO_BED_LEVELING
#elif defined(ENABLE_AUTO_BED_LEVELING)
apply_rotation_xyz(plan_bed_level_matrix, x, y, z);
#endif
@ -979,10 +977,10 @@ float junction_deviation = 0.1;
void plan_set_position(const float &x, const float &y, const float &z, const float &e)
#endif // ENABLE_AUTO_BED_LEVELING || MESH_BED_LEVELING
{
#ifdef ENABLE_AUTO_BED_LEVELING
apply_rotation_xyz(plan_bed_level_matrix, x, y, z);
#elif defined(MESH_BED_LEVELING)
#ifdef MESH_BED_LEVELING
if (mbl.active) z += mbl.get_z(x, y);
#elif defined(ENABLE_AUTO_BED_LEVELING)
apply_rotation_xyz(plan_bed_level_matrix, x, y, z);
#endif
float nx = position[X_AXIS] = lround(x * axis_steps_per_unit[X_AXIS]);