Browse Source

Merge pull request #3979 from thinkyhead/mbl_cell

MBL: cel => cell
pull/1/head
Scott Lahteine 9 years ago
parent
commit
3d56b9d127
  1. 8
      Marlin/Marlin_main.cpp
  2. 8
      Marlin/mesh_bed_leveling.h

8
Marlin/Marlin_main.cpp

@ -7386,10 +7386,10 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate,
set_current_to_destination(); set_current_to_destination();
return; return;
} }
int pcx = mbl.cel_index_x(current_position[X_AXIS] - home_offset[X_AXIS]); int pcx = mbl.cell_index_x(current_position[X_AXIS] - home_offset[X_AXIS]);
int pcy = mbl.cel_index_y(current_position[Y_AXIS] - home_offset[Y_AXIS]); int pcy = mbl.cell_index_y(current_position[Y_AXIS] - home_offset[Y_AXIS]);
int cx = mbl.cel_index_x(x - home_offset[X_AXIS]); int cx = mbl.cell_index_x(x - home_offset[X_AXIS]);
int cy = mbl.cel_index_y(y - home_offset[Y_AXIS]); int cy = mbl.cell_index_y(y - home_offset[Y_AXIS]);
NOMORE(pcx, MESH_NUM_X_POINTS - 2); NOMORE(pcx, MESH_NUM_X_POINTS - 2);
NOMORE(pcy, MESH_NUM_Y_POINTS - 2); NOMORE(pcy, MESH_NUM_Y_POINTS - 2);
NOMORE(cx, MESH_NUM_X_POINTS - 2); NOMORE(cx, MESH_NUM_X_POINTS - 2);

8
Marlin/mesh_bed_leveling.h

@ -60,12 +60,12 @@
set_z(px, py, z); set_z(px, py, z);
} }
int8_t cel_index_x(float x) { int8_t cell_index_x(float x) {
int8_t cx = int(x - (MESH_MIN_X)) / (MESH_X_DIST); int8_t cx = int(x - (MESH_MIN_X)) / (MESH_X_DIST);
return constrain(cx, 0, (MESH_NUM_X_POINTS) - 2); return constrain(cx, 0, (MESH_NUM_X_POINTS) - 2);
} }
int8_t cel_index_y(float y) { int8_t cell_index_y(float y) {
int8_t cy = int(y - (MESH_MIN_Y)) / (MESH_Y_DIST); int8_t cy = int(y - (MESH_MIN_Y)) / (MESH_Y_DIST);
return constrain(cy, 0, (MESH_NUM_Y_POINTS) - 2); return constrain(cy, 0, (MESH_NUM_Y_POINTS) - 2);
} }
@ -87,8 +87,8 @@
} }
float get_z(float x0, float y0) { float get_z(float x0, float y0) {
int8_t cx = cel_index_x(x0), int8_t cx = cell_index_x(x0),
cy = cel_index_y(y0); cy = cell_index_y(y0);
if (cx < 0 || cy < 0) return z_offset; if (cx < 0 || cy < 0) return z_offset;
float z1 = calc_z0(x0, float z1 = calc_z0(x0,
get_probe_x(cx), z_values[cy][cx], get_probe_x(cx), z_values[cy][cx],

Loading…
Cancel
Save