Move MBL functions into the class

This commit is contained in:
Scott Lahteine 2018-01-07 00:03:16 -06:00
parent eec97a5cf1
commit be555e3578
4 changed files with 22 additions and 13 deletions

View file

@ -2537,7 +2537,7 @@ static void clean_up_after_endstop_or_probe_move() {
/**
* Print calibration results for plotting or manual frame adjustment.
*/
static void print_2d_array(const uint8_t sx, const uint8_t sy, const uint8_t precision, float (*fn)(const uint8_t, const uint8_t)) {
void print_2d_array(const uint8_t sx, const uint8_t sy, const uint8_t precision, const element_2d_fn fn) {
#ifndef SCAD_MESH_OUTPUT
for (uint8_t x = 0; x < sx; x++) {
for (uint8_t i = 0; i < precision + 2 + (x < 10 ? 1 : 0); i++)
@ -4089,15 +4089,6 @@ void home_all_axes() { gcode_G28(true); }
// Save 130 bytes with non-duplication of PSTR
void echo_not_entered() { SERIAL_PROTOCOLLNPGM(" not entered."); }
void mbl_mesh_report() {
SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(GRID_MAX_POINTS_X) "," STRINGIFY(GRID_MAX_POINTS_Y));
SERIAL_PROTOCOLPGM("Z offset: "); SERIAL_PROTOCOL_F(mbl.z_offset, 5);
SERIAL_PROTOCOLLNPGM("\nMeasured points:");
print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 5,
[](const uint8_t ix, const uint8_t iy) { return mbl.z_values[ix][iy]; }
);
}
/**
* G29: Mesh-based Z probe, probes a grid and produces a
* mesh to compensate for variable bed height
@ -4138,7 +4129,7 @@ void home_all_axes() { gcode_G28(true); }
case MeshReport:
if (leveling_is_valid()) {
SERIAL_PROTOCOLLNPAIR("State: ", planner.leveling_active ? MSG_ON : MSG_OFF);
mbl_mesh_report();
mbl.report_mesh();
}
else
SERIAL_PROTOCOLLNPGM("Mesh bed leveling has no data.");
@ -9630,7 +9621,7 @@ void quickstop_stepper() {
#endif
#elif ENABLED(MESH_BED_LEVELING)
SERIAL_ECHOLNPGM("Mesh Bed Level data:");
mbl_mesh_report();
mbl.report_mesh();
#endif
}
#endif