Make mbl.has_mesh() a method

This commit is contained in:
Scott Lahteine
2018-01-06 23:47:29 -06:00
parent 86818c9a89
commit 60d07f20e7
5 changed files with 10 additions and 21 deletions

View File

@ -49,7 +49,7 @@
bool leveling_is_valid() {
return
#if ENABLED(MESH_BED_LEVELING)
mbl.has_mesh
mbl.has_mesh()
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
!!bilinear_grid_spacing[X_AXIS]
#elif ENABLED(AUTO_BED_LEVELING_UBL)

View File

@ -31,8 +31,6 @@
mesh_bed_leveling mbl;
bool mesh_bed_leveling::has_mesh;
float mesh_bed_leveling::z_offset,
mesh_bed_leveling::z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y],
mesh_bed_leveling::index_to_xpos[GRID_MAX_POINTS_X],
@ -47,7 +45,6 @@
}
void mesh_bed_leveling::reset() {
has_mesh = false;
z_offset = 0;
ZERO(z_values);
}

View File

@ -39,7 +39,6 @@ enum MeshLevelingState {
class mesh_bed_leveling {
public:
static bool has_mesh;
static float z_offset,
z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y],
index_to_xpos[GRID_MAX_POINTS_X],
@ -51,6 +50,13 @@ public:
static void reset();
FORCE_INLINE static bool has_mesh() {
for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
if (z_values[x][y]) return true;
return false;
}
static void set_z(const int8_t px, const int8_t py, const float &z) { z_values[px][py] = z; }
static inline void zigzag(const int8_t index, int8_t &px, int8_t &py) {