UBL G29 parity with 2.0.x

This commit is contained in:
Scott Lahteine 2018-03-21 01:12:33 -05:00
parent d9e1cbebea
commit 203d3f8f56

View File

@ -507,7 +507,7 @@
} }
else { else {
const float cvf = parser.value_float(); const float cvf = parser.value_float();
switch((int)truncf(cvf * 10.0) - 30) { // 3.1 -> 1 switch ((int)truncf(cvf * 10.0) - 30) { // 3.1 -> 1
#if ENABLED(UBL_G29_P31) #if ENABLED(UBL_G29_P31)
case 1: { case 1: {
@ -707,7 +707,7 @@
* Probe all invalidated locations of the mesh that can be reached by the probe. * Probe all invalidated locations of the mesh that can be reached by the probe.
* This attempts to fill in locations closest to the nozzle's start location first. * This attempts to fill in locations closest to the nozzle's start location first.
*/ */
void unified_bed_leveling::probe_entire_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map, const bool stow_probe, bool close_or_far) { void unified_bed_leveling::probe_entire_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) {
mesh_index_pair location; mesh_index_pair location;
#if ENABLED(NEWPANEL) #if ENABLED(NEWPANEL)
@ -717,7 +717,7 @@
save_ubl_active_state_and_disable(); // we don't do bed level correction because we want the raw data when we probe save_ubl_active_state_and_disable(); // we don't do bed level correction because we want the raw data when we probe
DEPLOY_PROBE(); DEPLOY_PROBE();
uint16_t max_iterations = GRID_MAX_POINTS; uint16_t count = GRID_MAX_POINTS;
do { do {
if (do_ubl_mesh_map) display_map(g29_map_type); if (do_ubl_mesh_map) display_map(g29_map_type);
@ -736,7 +736,7 @@
} }
#endif #endif
if (close_or_far) if (do_furthest)
location = find_furthest_invalid_mesh_point(); location = find_furthest_invalid_mesh_point();
else else
location = find_closest_mesh_point_of_type(INVALID, rx, ry, USE_PROBE_AS_REFERENCE, NULL); location = find_closest_mesh_point_of_type(INVALID, rx, ry, USE_PROBE_AS_REFERENCE, NULL);
@ -749,7 +749,7 @@
z_values[location.x_index][location.y_index] = measured_z; z_values[location.x_index][location.y_index] = measured_z;
} }
SERIAL_FLUSH(); // Prevent host M105 buffer overrun. SERIAL_FLUSH(); // Prevent host M105 buffer overrun.
} while (location.x_index >= 0 && --max_iterations); } while (location.x_index >= 0 && --count);
STOW_PROBE(); STOW_PROBE();