Merge upstream changes from Marlin 2.1.2.2
This commit is contained in:
@@ -57,8 +57,9 @@
|
||||
* 41 - Counter-Clockwise M4
|
||||
* 50 - Clockwise M5
|
||||
* 51 - Counter-Clockwise M5
|
||||
**/
|
||||
*/
|
||||
void GcodeSuite::G35() {
|
||||
|
||||
DEBUG_SECTION(log_G35, "G35", DEBUGGING(LEVELING));
|
||||
|
||||
if (DEBUGGING(LEVELING)) log_machine_info();
|
||||
@@ -82,9 +83,7 @@ void GcodeSuite::G35() {
|
||||
set_bed_leveling_enabled(false);
|
||||
#endif
|
||||
|
||||
#if ENABLED(CNC_WORKSPACE_PLANES)
|
||||
workspace_plane = PLANE_XY;
|
||||
#endif
|
||||
TERN_(CNC_WORKSPACE_PLANES, workspace_plane = PLANE_XY);
|
||||
|
||||
// Always home with tool 0 active
|
||||
#if HAS_MULTI_HOTEND
|
||||
@@ -101,7 +100,7 @@ void GcodeSuite::G35() {
|
||||
bool err_break = false;
|
||||
|
||||
// Probe all positions
|
||||
LOOP_L_N(i, G35_PROBE_COUNT) {
|
||||
for (uint8_t i = 0; i < G35_PROBE_COUNT; ++i) {
|
||||
|
||||
// In BLTOUCH HS mode, the probe travels in a deployed state.
|
||||
// Users of G35 might have a badly misaligned bed, so raise Z by the
|
||||
@@ -134,7 +133,7 @@ void GcodeSuite::G35() {
|
||||
const float threads_factor[] = { 0.5, 0.7, 0.8 };
|
||||
|
||||
// Calculate adjusts
|
||||
LOOP_S_L_N(i, 1, G35_PROBE_COUNT) {
|
||||
for (uint8_t i = 1; i < G35_PROBE_COUNT; ++i) {
|
||||
const float diff = z_measured[0] - z_measured[i],
|
||||
adjust = ABS(diff) < 0.001f ? 0 : diff / threads_factor[(screw_thread - 30) / 10];
|
||||
|
||||
@@ -158,7 +157,7 @@ void GcodeSuite::G35() {
|
||||
if (old_tool_index != 0) tool_change(old_tool_index, DISABLED(PARKING_EXTRUDER)); // Fetch previous toolhead if not PARKING_EXTRUDER
|
||||
#endif
|
||||
|
||||
#if BOTH(HAS_LEVELING, RESTORE_LEVELING_AFTER_G35)
|
||||
#if ALL(HAS_LEVELING, RESTORE_LEVELING_AFTER_G35)
|
||||
set_bed_leveling_enabled(leveling_was_active);
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user