|
|
|
@ -51,7 +51,7 @@
|
|
|
|
|
|
|
|
|
|
#if ENABLED(NEWPANEL)
|
|
|
|
|
void lcd_return_to_status();
|
|
|
|
|
extern void _lcd_ubl_output_map_lcd();
|
|
|
|
|
void _lcd_ubl_output_map_lcd();
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
extern float meshedit_done;
|
|
|
|
@ -97,7 +97,7 @@
|
|
|
|
|
*
|
|
|
|
|
* C G29 P2 C tells the Manual Probe subsystem to not use the current nozzle
|
|
|
|
|
* location in its search for the closest unmeasured Mesh Point. Instead, attempt to
|
|
|
|
|
* start at one end of the uprobed points and Continue sequentually.
|
|
|
|
|
* start at one end of the uprobed points and Continue sequentially.
|
|
|
|
|
*
|
|
|
|
|
* G29 P3 C specifies the Constant for the fill. Otherwise, uses a "reasonable" value.
|
|
|
|
|
*
|
|
|
|
@ -1038,12 +1038,12 @@
|
|
|
|
|
|
|
|
|
|
static uint8_t ubl_state_at_invocation = 0;
|
|
|
|
|
|
|
|
|
|
#if ENABLED(UBL_DEVEL_DEBUGGING)
|
|
|
|
|
#ifdef UBL_DEVEL_DEBUGGING
|
|
|
|
|
static uint8_t ubl_state_recursion_chk = 0;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
void unified_bed_leveling::save_ubl_active_state_and_disable() {
|
|
|
|
|
#if ENABLED(UBL_DEVEL_DEBUGGING)
|
|
|
|
|
#ifdef UBL_DEVEL_DEBUGGING
|
|
|
|
|
ubl_state_recursion_chk++;
|
|
|
|
|
if (ubl_state_recursion_chk != 1) {
|
|
|
|
|
SERIAL_ECHOLNPGM("save_ubl_active_state_and_disabled() called multiple times in a row.");
|
|
|
|
@ -1059,7 +1059,7 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void unified_bed_leveling::restore_ubl_active_state_and_leave() {
|
|
|
|
|
#if ENABLED(UBL_DEVEL_DEBUGGING)
|
|
|
|
|
#ifdef UBL_DEVEL_DEBUGGING
|
|
|
|
|
if (--ubl_state_recursion_chk) {
|
|
|
|
|
SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times.");
|
|
|
|
|
#if ENABLED(NEWPANEL)
|
|
|
|
@ -1143,7 +1143,7 @@
|
|
|
|
|
SERIAL_EOL();
|
|
|
|
|
safe_delay(50);
|
|
|
|
|
|
|
|
|
|
#if ENABLED(UBL_DEVEL_DEBUGGING)
|
|
|
|
|
#ifdef UBL_DEVEL_DEBUGGING
|
|
|
|
|
SERIAL_PROTOCOLLNPAIR("ubl_state_at_invocation :", ubl_state_at_invocation);
|
|
|
|
|
SERIAL_EOL();
|
|
|
|
|
SERIAL_PROTOCOLLNPAIR("ubl_state_recursion_chk :", ubl_state_recursion_chk);
|
|
|
|
@ -1280,7 +1280,7 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// at this point d2 should have the closest defined mesh point to invalid mesh point (i,j)
|
|
|
|
|
// At this point d2 should have the closest defined mesh point to invalid mesh point (i,j)
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
if (found_a_real && (closest_x >= 0) && (d2 > out_mesh.distance)) {
|
|
|
|
@ -1584,7 +1584,8 @@
|
|
|
|
|
SERIAL_ECHOPGM("?Error probing point. Aborting operation.\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
else { // !do_3_pt_leveling
|
|
|
|
|
|
|
|
|
|
bool zig_zag = false;
|
|
|
|
|
for (uint8_t ix = 0; ix < g29_grid_size; ix++) {
|
|
|
|
@ -1595,8 +1596,7 @@
|
|
|
|
|
if (!abort_flag) {
|
|
|
|
|
measured_z = probe_pt(rx, ry, parser.seen('E'), g29_verbose_level); // TODO: Needs error handling
|
|
|
|
|
|
|
|
|
|
if (isnan(measured_z))
|
|
|
|
|
abort_flag = true;
|
|
|
|
|
abort_flag = isnan(measured_z);
|
|
|
|
|
|
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
|
if (DEBUGGING(LEVELING)) {
|
|
|
|
@ -1640,7 +1640,6 @@
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vector_3 normal = vector_3(lsf_results.A, lsf_results.B, 1.0000).get_normal();
|
|
|
|
|
|
|
|
|
|
if (g29_verbose_level > 2) {
|
|
|
|
@ -1714,7 +1713,7 @@
|
|
|
|
|
SERIAL_ECHOPGM("]\n");
|
|
|
|
|
SERIAL_EOL();
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
/**
|
|
|
|
|
* The following code can be used to check the validity of the mesh tilting algorithm.
|
|
|
|
|
* When a 3-Point Mesh Tilt is done, the same algorithm is used as the grid based tilting.
|
|
|
|
|
* The only difference is just 3 points are used in the calculations. That fact guarantees
|
|
|
|
@ -1722,7 +1721,7 @@
|
|
|
|
|
* is calculated. The Z error between the probed point locations and the get_z_correction()
|
|
|
|
|
* numbers for those locations should be 0.000
|
|
|
|
|
*/
|
|
|
|
|
/*
|
|
|
|
|
#if 0
|
|
|
|
|
float t, t1, d;
|
|
|
|
|
t = normal.x * (UBL_PROBE_PT_1_X) + normal.y * (UBL_PROBE_PT_1_Y);
|
|
|
|
|
d = t + normal.z * z1;
|
|
|
|
@ -1765,8 +1764,8 @@
|
|
|
|
|
SERIAL_ECHOPGM(") = ");
|
|
|
|
|
SERIAL_ECHO_F(get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT), 6);
|
|
|
|
|
SERIAL_EOL();
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
} // DEBUGGING(LEVELING)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|