Skip to content

Commit

Permalink
also
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jan 4, 2021
1 parent bb4b4c9 commit e625878
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,25 +309,14 @@ void BedMeshScreen::onMeshUpdate(const int8_t, const int8_t, const float) {
onRefresh();
}

bool BedMeshScreen::isMeshComplete(ExtUI::bed_mesh_t data) {
for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) {
for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) {
if (isnan(data[x][y])) {
return false;
}
}
}
return true;
}

void BedMeshScreen::onMeshUpdate(const int8_t x, const int8_t y, const ExtUI::probe_state_t state) {
switch (state) {
case ExtUI::MESH_START:
screen_data.BedMesh.count = 0;
screen_data.BedMesh.message = screen_data.BedMesh.MSG_NONE;
break;
case ExtUI::MESH_FINISH:
if (screen_data.BedMesh.count == GRID_MAX_POINTS && isMeshComplete(ExtUI::getMeshArray()))
if (screen_data.BedMesh.count == GRID_MAX_POINTS && ExtUI::getMeshValid())
screen_data.BedMesh.message = screen_data.BedMesh.MSG_MESH_COMPLETE;
else
screen_data.BedMesh.message = screen_data.BedMesh.MSG_MESH_INCOMPLETE;
Expand Down

0 comments on commit e625878

Please sign in to comment.