Make MBL a static class, use lookup for index-to-point conversion

This commit is contained in:
Scott Lahteine
2017-03-31 01:28:07 -05:00
parent de9d2cddc3
commit c9eb1d6ab7
4 changed files with 52 additions and 47 deletions

View File

@ -26,7 +26,20 @@
mesh_bed_leveling mbl;
mesh_bed_leveling::mesh_bed_leveling() { reset(); }
uint8_t mesh_bed_leveling::status;
float mesh_bed_leveling::z_offset,
mesh_bed_leveling::z_values[MESH_NUM_Y_POINTS][MESH_NUM_X_POINTS],
mesh_bed_leveling::index_to_xpos[MESH_NUM_X_POINTS],
mesh_bed_leveling::index_to_ypos[MESH_NUM_Y_POINTS];
mesh_bed_leveling::mesh_bed_leveling() {
for (uint8_t i = 0; i < MESH_NUM_X_POINTS; ++i)
index_to_xpos[i] = MESH_MIN_X + i * (MESH_X_DIST);
for (uint8_t i = 0; i < MESH_NUM_Y_POINTS; ++i)
index_to_ypos[i] = MESH_MIN_Y + i * (MESH_Y_DIST);
reset();
}
void mesh_bed_leveling::reset() {
status = MBL_STATUS_NONE;