|
@@ -2958,169 +2958,169 @@ void process_commands()
|
|
|
break;
|
|
|
#endif
|
|
|
case 28:
|
|
|
- {
|
|
|
- st_synchronize();
|
|
|
+ {
|
|
|
+ st_synchronize();
|
|
|
|
|
|
#if 0
|
|
|
- SERIAL_ECHOPGM("G28, initial "); print_world_coordinates();
|
|
|
- SERIAL_ECHOPGM("G28, initial "); print_physical_coordinates();
|
|
|
+ SERIAL_ECHOPGM("G28, initial "); print_world_coordinates();
|
|
|
+ SERIAL_ECHOPGM("G28, initial "); print_physical_coordinates();
|
|
|
#endif
|
|
|
|
|
|
-
|
|
|
- homing_flag = true;
|
|
|
-
|
|
|
-
|
|
|
- bool home_x = code_seen(axis_codes[X_AXIS]);
|
|
|
- bool home_y = code_seen(axis_codes[Y_AXIS]);
|
|
|
- bool home_z = code_seen(axis_codes[Z_AXIS]);
|
|
|
-
|
|
|
- bool calib = code_seen('C');
|
|
|
-
|
|
|
- bool home_all_axes = home_x == home_y && home_x == home_z;
|
|
|
- if (home_all_axes)
|
|
|
-
|
|
|
- home_x = home_y = home_z = true;
|
|
|
+
|
|
|
+ homing_flag = true;
|
|
|
+
|
|
|
+
|
|
|
+ bool home_x = code_seen(axis_codes[X_AXIS]);
|
|
|
+ bool home_y = code_seen(axis_codes[Y_AXIS]);
|
|
|
+ bool home_z = code_seen(axis_codes[Z_AXIS]);
|
|
|
+
|
|
|
+ bool calib = code_seen('C');
|
|
|
+
|
|
|
+ bool home_all_axes = home_x == home_y && home_x == home_z;
|
|
|
+ if (home_all_axes)
|
|
|
+
|
|
|
+ home_x = home_y = home_z = true;
|
|
|
|
|
|
#ifdef ENABLE_AUTO_BED_LEVELING
|
|
|
- plan_bed_level_matrix.set_to_identity();
|
|
|
+ plan_bed_level_matrix.set_to_identity();
|
|
|
#endif
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- world2machine_revert_to_uncorrected();
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ world2machine_revert_to_uncorrected();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
#ifdef MESH_BED_LEVELING
|
|
|
- uint8_t mbl_was_active = mbl.active;
|
|
|
- mbl.active = 0;
|
|
|
- current_position[Z_AXIS] = st_get_position_mm(Z_AXIS);
|
|
|
+ uint8_t mbl_was_active = mbl.active;
|
|
|
+ mbl.active = 0;
|
|
|
+ current_position[Z_AXIS] = st_get_position_mm(Z_AXIS);
|
|
|
#endif
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- if (home_z)
|
|
|
- babystep_undo();
|
|
|
+
|
|
|
+
|
|
|
+ if (home_z)
|
|
|
+ babystep_undo();
|
|
|
|
|
|
- saved_feedrate = feedrate;
|
|
|
- saved_feedmultiply = feedmultiply;
|
|
|
- feedmultiply = 100;
|
|
|
- previous_millis_cmd = millis();
|
|
|
+ saved_feedrate = feedrate;
|
|
|
+ saved_feedmultiply = feedmultiply;
|
|
|
+ feedmultiply = 100;
|
|
|
+ previous_millis_cmd = millis();
|
|
|
|
|
|
- enable_endstops(true);
|
|
|
+ enable_endstops(true);
|
|
|
|
|
|
- memcpy(destination, current_position, sizeof(destination));
|
|
|
- feedrate = 0.0;
|
|
|
+ memcpy(destination, current_position, sizeof(destination));
|
|
|
+ feedrate = 0.0;
|
|
|
|
|
|
-#if Z_HOME_DIR > 0
|
|
|
- if(home_z)
|
|
|
- homeaxis(Z_AXIS);
|
|
|
-#endif
|
|
|
+ #if Z_HOME_DIR > 0
|
|
|
+ if(home_z)
|
|
|
+ homeaxis(Z_AXIS);
|
|
|
+ #endif
|
|
|
|
|
|
-#ifdef QUICK_HOME
|
|
|
-
|
|
|
- if(home_x && home_y)
|
|
|
- {
|
|
|
- current_position[X_AXIS] = 0;current_position[Y_AXIS] = 0;
|
|
|
+ #ifdef QUICK_HOME
|
|
|
+
|
|
|
+ if(home_x && home_y)
|
|
|
+ {
|
|
|
+ current_position[X_AXIS] = 0;current_position[Y_AXIS] = 0;
|
|
|
|
|
|
- int x_axis_home_dir = home_dir(X_AXIS);
|
|
|
+ int x_axis_home_dir = home_dir(X_AXIS);
|
|
|
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
- destination[X_AXIS] = 1.5 * max_length(X_AXIS) * x_axis_home_dir;destination[Y_AXIS] = 1.5 * max_length(Y_AXIS) * home_dir(Y_AXIS);
|
|
|
- feedrate = homing_feedrate[X_AXIS];
|
|
|
- if(homing_feedrate[Y_AXIS]<feedrate)
|
|
|
- feedrate = homing_feedrate[Y_AXIS];
|
|
|
- if (max_length(X_AXIS) > max_length(Y_AXIS)) {
|
|
|
- feedrate *= sqrt(pow(max_length(Y_AXIS) / max_length(X_AXIS), 2) + 1);
|
|
|
- } else {
|
|
|
- feedrate *= sqrt(pow(max_length(X_AXIS) / max_length(Y_AXIS), 2) + 1);
|
|
|
- }
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
|
|
- st_synchronize();
|
|
|
+ plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ destination[X_AXIS] = 1.5 * max_length(X_AXIS) * x_axis_home_dir;destination[Y_AXIS] = 1.5 * max_length(Y_AXIS) * home_dir(Y_AXIS);
|
|
|
+ feedrate = homing_feedrate[X_AXIS];
|
|
|
+ if(homing_feedrate[Y_AXIS]<feedrate)
|
|
|
+ feedrate = homing_feedrate[Y_AXIS];
|
|
|
+ if (max_length(X_AXIS) > max_length(Y_AXIS)) {
|
|
|
+ feedrate *= sqrt(pow(max_length(Y_AXIS) / max_length(X_AXIS), 2) + 1);
|
|
|
+ } else {
|
|
|
+ feedrate *= sqrt(pow(max_length(X_AXIS) / max_length(Y_AXIS), 2) + 1);
|
|
|
+ }
|
|
|
+ plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
|
|
+ st_synchronize();
|
|
|
|
|
|
- axis_is_at_home(X_AXIS);
|
|
|
- axis_is_at_home(Y_AXIS);
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
- destination[X_AXIS] = current_position[X_AXIS];
|
|
|
- destination[Y_AXIS] = current_position[Y_AXIS];
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
|
|
- feedrate = 0.0;
|
|
|
- st_synchronize();
|
|
|
- endstops_hit_on_purpose();
|
|
|
+ axis_is_at_home(X_AXIS);
|
|
|
+ axis_is_at_home(Y_AXIS);
|
|
|
+ plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ destination[X_AXIS] = current_position[X_AXIS];
|
|
|
+ destination[Y_AXIS] = current_position[Y_AXIS];
|
|
|
+ plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
|
|
+ feedrate = 0.0;
|
|
|
+ st_synchronize();
|
|
|
+ endstops_hit_on_purpose();
|
|
|
|
|
|
- current_position[X_AXIS] = destination[X_AXIS];
|
|
|
- current_position[Y_AXIS] = destination[Y_AXIS];
|
|
|
- current_position[Z_AXIS] = destination[Z_AXIS];
|
|
|
- }
|
|
|
-#endif
|
|
|
+ current_position[X_AXIS] = destination[X_AXIS];
|
|
|
+ current_position[Y_AXIS] = destination[Y_AXIS];
|
|
|
+ current_position[Z_AXIS] = destination[Z_AXIS];
|
|
|
+ }
|
|
|
+ #endif
|
|
|
|
|
|
#ifdef TMC2130
|
|
|
- if(home_x)
|
|
|
- {
|
|
|
- if (!calib)
|
|
|
- homeaxis(X_AXIS);
|
|
|
- else
|
|
|
- tmc2130_home_calibrate(X_AXIS);
|
|
|
- }
|
|
|
+ if(home_x)
|
|
|
+ {
|
|
|
+ if (!calib)
|
|
|
+ homeaxis(X_AXIS);
|
|
|
+ else
|
|
|
+ tmc2130_home_calibrate(X_AXIS);
|
|
|
+ }
|
|
|
|
|
|
- if(home_y)
|
|
|
- {
|
|
|
- if (!calib)
|
|
|
- homeaxis(Y_AXIS);
|
|
|
- else
|
|
|
- tmc2130_home_calibrate(Y_AXIS);
|
|
|
- }
|
|
|
+ if(home_y)
|
|
|
+ {
|
|
|
+ if (!calib)
|
|
|
+ homeaxis(Y_AXIS);
|
|
|
+ else
|
|
|
+ tmc2130_home_calibrate(Y_AXIS);
|
|
|
+ }
|
|
|
#endif
|
|
|
|
|
|
|
|
|
- if(code_seen(axis_codes[X_AXIS]) && code_value_long() != 0)
|
|
|
- current_position[X_AXIS]=code_value()+add_homing[X_AXIS];
|
|
|
-
|
|
|
- if(code_seen(axis_codes[Y_AXIS]) && code_value_long() != 0)
|
|
|
- current_position[Y_AXIS]=code_value()+add_homing[Y_AXIS];
|
|
|
-
|
|
|
-#if Z_HOME_DIR < 0 // If homing towards BED do Z last
|
|
|
-#ifndef Z_SAFE_HOMING
|
|
|
- if(home_z) {
|
|
|
-#if defined (Z_RAISE_BEFORE_HOMING) && (Z_RAISE_BEFORE_HOMING > 0)
|
|
|
- destination[Z_AXIS] = Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS) * (-1);
|
|
|
- feedrate = max_feedrate[Z_AXIS];
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder);
|
|
|
- st_synchronize();
|
|
|
-#endif
|
|
|
-#if (defined(MESH_BED_LEVELING) && !defined(MK1BP))
|
|
|
- if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] ))
|
|
|
- {
|
|
|
+ if(code_seen(axis_codes[X_AXIS]) && code_value_long() != 0)
|
|
|
+ current_position[X_AXIS]=code_value()+add_homing[X_AXIS];
|
|
|
+
|
|
|
+ if(code_seen(axis_codes[Y_AXIS]) && code_value_long() != 0)
|
|
|
+ current_position[Y_AXIS]=code_value()+add_homing[Y_AXIS];
|
|
|
+
|
|
|
+ #if Z_HOME_DIR < 0 // If homing towards BED do Z last
|
|
|
+ #ifndef Z_SAFE_HOMING
|
|
|
+ if(home_z) {
|
|
|
+ #if defined (Z_RAISE_BEFORE_HOMING) && (Z_RAISE_BEFORE_HOMING > 0)
|
|
|
+ destination[Z_AXIS] = Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS) * (-1);
|
|
|
+ feedrate = max_feedrate[Z_AXIS];
|
|
|
+ plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder);
|
|
|
+ st_synchronize();
|
|
|
+ #endif
|
|
|
+ #if (defined(MESH_BED_LEVELING) && !defined(MK1BP))
|
|
|
+ if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] ))
|
|
|
+ {
|
|
|
homeaxis(X_AXIS);
|
|
|
homeaxis(Y_AXIS);
|
|
|
- }
|
|
|
-
|
|
|
- world2machine_initialize();
|
|
|
- world2machine(pgm_read_float(bed_ref_points), pgm_read_float(bed_ref_points+1), destination[X_AXIS], destination[Y_AXIS]);
|
|
|
- world2machine_reset();
|
|
|
- if (destination[Y_AXIS] < Y_MIN_POS)
|
|
|
- destination[Y_AXIS] = Y_MIN_POS;
|
|
|
- destination[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
|
|
- feedrate = homing_feedrate[Z_AXIS]/10;
|
|
|
- current_position[Z_AXIS] = 0;
|
|
|
- enable_endstops(false);
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder);
|
|
|
- st_synchronize();
|
|
|
- current_position[X_AXIS] = destination[X_AXIS];
|
|
|
- current_position[Y_AXIS] = destination[Y_AXIS];
|
|
|
- enable_endstops(true);
|
|
|
- endstops_hit_on_purpose();
|
|
|
- homeaxis(Z_AXIS);
|
|
|
-#else
|
|
|
- homeaxis(Z_AXIS);
|
|
|
-#endif
|
|
|
- }
|
|
|
-#else
|
|
|
- if(home_all_axes) {
|
|
|
+ }
|
|
|
+
|
|
|
+ world2machine_initialize();
|
|
|
+ world2machine(pgm_read_float(bed_ref_points), pgm_read_float(bed_ref_points+1), destination[X_AXIS], destination[Y_AXIS]);
|
|
|
+ world2machine_reset();
|
|
|
+ if (destination[Y_AXIS] < Y_MIN_POS)
|
|
|
+ destination[Y_AXIS] = Y_MIN_POS;
|
|
|
+ destination[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
|
|
+ feedrate = homing_feedrate[Z_AXIS]/10;
|
|
|
+ current_position[Z_AXIS] = 0;
|
|
|
+ enable_endstops(false);
|
|
|
+ plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder);
|
|
|
+ st_synchronize();
|
|
|
+ current_position[X_AXIS] = destination[X_AXIS];
|
|
|
+ current_position[Y_AXIS] = destination[Y_AXIS];
|
|
|
+ enable_endstops(true);
|
|
|
+ endstops_hit_on_purpose();
|
|
|
+ homeaxis(Z_AXIS);
|
|
|
+ #else
|
|
|
+ homeaxis(Z_AXIS);
|
|
|
+ #endif
|
|
|
+ }
|
|
|
+ #else
|
|
|
+ if(home_all_axes) {
|
|
|
destination[X_AXIS] = round(Z_SAFE_HOMING_X_POINT - X_PROBE_OFFSET_FROM_EXTRUDER);
|
|
|
destination[Y_AXIS] = round(Z_SAFE_HOMING_Y_POINT - Y_PROBE_OFFSET_FROM_EXTRUDER);
|
|
|
destination[Z_AXIS] = Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS) * (-1);
|
|
@@ -3134,23 +3134,23 @@ void process_commands()
|
|
|
current_position[Y_AXIS] = destination[Y_AXIS];
|
|
|
|
|
|
homeaxis(Z_AXIS);
|
|
|
- }
|
|
|
-
|
|
|
- if(home_z) {
|
|
|
+ }
|
|
|
+
|
|
|
+ if(home_z) {
|
|
|
if ( (axis_known_position[X_AXIS]) && (axis_known_position[Y_AXIS]) \
|
|
|
- && (current_position[X_AXIS]+X_PROBE_OFFSET_FROM_EXTRUDER >= X_MIN_POS) \
|
|
|
- && (current_position[X_AXIS]+X_PROBE_OFFSET_FROM_EXTRUDER <= X_MAX_POS) \
|
|
|
- && (current_position[Y_AXIS]+Y_PROBE_OFFSET_FROM_EXTRUDER >= Y_MIN_POS) \
|
|
|
- && (current_position[Y_AXIS]+Y_PROBE_OFFSET_FROM_EXTRUDER <= Y_MAX_POS)) {
|
|
|
-
|
|
|
- current_position[Z_AXIS] = 0;
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
- destination[Z_AXIS] = Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS) * (-1);
|
|
|
- feedrate = max_feedrate[Z_AXIS];
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder);
|
|
|
- st_synchronize();
|
|
|
-
|
|
|
- homeaxis(Z_AXIS);
|
|
|
+ && (current_position[X_AXIS]+X_PROBE_OFFSET_FROM_EXTRUDER >= X_MIN_POS) \
|
|
|
+ && (current_position[X_AXIS]+X_PROBE_OFFSET_FROM_EXTRUDER <= X_MAX_POS) \
|
|
|
+ && (current_position[Y_AXIS]+Y_PROBE_OFFSET_FROM_EXTRUDER >= Y_MIN_POS) \
|
|
|
+ && (current_position[Y_AXIS]+Y_PROBE_OFFSET_FROM_EXTRUDER <= Y_MAX_POS)) {
|
|
|
+
|
|
|
+ current_position[Z_AXIS] = 0;
|
|
|
+ plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ destination[Z_AXIS] = Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS) * (-1);
|
|
|
+ feedrate = max_feedrate[Z_AXIS];
|
|
|
+ plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder);
|
|
|
+ st_synchronize();
|
|
|
+
|
|
|
+ homeaxis(Z_AXIS);
|
|
|
} else if (!((axis_known_position[X_AXIS]) && (axis_known_position[Y_AXIS]))) {
|
|
|
LCD_MESSAGERPGM(MSG_POSITION_UNKNOWN);
|
|
|
SERIAL_ECHO_START;
|
|
@@ -3160,72 +3160,72 @@ void process_commands()
|
|
|
SERIAL_ECHO_START;
|
|
|
SERIAL_ECHOLNRPGM(MSG_ZPROBE_OUT);
|
|
|
}
|
|
|
- }
|
|
|
-#endif
|
|
|
-#endif
|
|
|
+ }
|
|
|
+ #endif
|
|
|
+ #endif
|
|
|
|
|
|
- if(code_seen(axis_codes[Z_AXIS]) && code_value_long() != 0)
|
|
|
- current_position[Z_AXIS]=code_value()+add_homing[Z_AXIS];
|
|
|
-#ifdef ENABLE_AUTO_BED_LEVELING
|
|
|
+ if(code_seen(axis_codes[Z_AXIS]) && code_value_long() != 0)
|
|
|
+ current_position[Z_AXIS]=code_value()+add_homing[Z_AXIS];
|
|
|
+ #ifdef ENABLE_AUTO_BED_LEVELING
|
|
|
if(home_z)
|
|
|
- current_position[Z_AXIS] += zprobe_zoffset;
|
|
|
-#endif
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ current_position[Z_AXIS] += zprobe_zoffset;
|
|
|
+ #endif
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
|
|
|
-#ifdef ENDSTOPS_ONLY_FOR_HOMING
|
|
|
+ #ifdef ENDSTOPS_ONLY_FOR_HOMING
|
|
|
enable_endstops(false);
|
|
|
-#endif
|
|
|
+ #endif
|
|
|
|
|
|
- feedrate = saved_feedrate;
|
|
|
- feedmultiply = saved_feedmultiply;
|
|
|
- previous_millis_cmd = millis();
|
|
|
- endstops_hit_on_purpose();
|
|
|
+ feedrate = saved_feedrate;
|
|
|
+ feedmultiply = saved_feedmultiply;
|
|
|
+ previous_millis_cmd = millis();
|
|
|
+ endstops_hit_on_purpose();
|
|
|
#ifndef MESH_BED_LEVELING
|
|
|
-
|
|
|
-
|
|
|
- if(card.sdprinting && eeprom_read_word((uint16_t *)EEPROM_BABYSTEP_Z))
|
|
|
- lcd_adjust_z();
|
|
|
+
|
|
|
+
|
|
|
+ if(card.sdprinting && eeprom_read_word((uint16_t *)EEPROM_BABYSTEP_Z))
|
|
|
+ lcd_adjust_z();
|
|
|
#endif
|
|
|
|
|
|
-
|
|
|
- world2machine_initialize();
|
|
|
-
|
|
|
- world2machine_update_current();
|
|
|
+
|
|
|
+ world2machine_initialize();
|
|
|
+
|
|
|
+ world2machine_update_current();
|
|
|
|
|
|
#if (defined(MESH_BED_LEVELING) && !defined(MK1BP))
|
|
|
- if (code_seen(axis_codes[X_AXIS]) || code_seen(axis_codes[Y_AXIS]) || code_seen('W') || code_seen(axis_codes[Z_AXIS]))
|
|
|
- {
|
|
|
- if (! home_z && mbl_was_active) {
|
|
|
-
|
|
|
- mbl.active = true;
|
|
|
-
|
|
|
- current_position[Z_AXIS] -= mbl.get_z(st_get_position_mm(X_AXIS), st_get_position_mm(Y_AXIS));
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- st_synchronize();
|
|
|
- homing_flag = false;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- goto case_G80;
|
|
|
- }
|
|
|
+ if (code_seen(axis_codes[X_AXIS]) || code_seen(axis_codes[Y_AXIS]) || code_seen('W') || code_seen(axis_codes[Z_AXIS]))
|
|
|
+ {
|
|
|
+ if (! home_z && mbl_was_active) {
|
|
|
+
|
|
|
+ mbl.active = true;
|
|
|
+
|
|
|
+ current_position[Z_AXIS] -= mbl.get_z(st_get_position_mm(X_AXIS), st_get_position_mm(Y_AXIS));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ st_synchronize();
|
|
|
+ homing_flag = false;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ goto case_G80;
|
|
|
+ }
|
|
|
#endif
|
|
|
|
|
|
- if (farm_mode) { prusa_statistics(20); };
|
|
|
+ if (farm_mode) { prusa_statistics(20); };
|
|
|
|
|
|
- homing_flag = false;
|
|
|
+ homing_flag = false;
|
|
|
#if 0
|
|
|
- SERIAL_ECHOPGM("G28, final "); print_world_coordinates();
|
|
|
- SERIAL_ECHOPGM("G28, final "); print_physical_coordinates();
|
|
|
- SERIAL_ECHOPGM("G28, final "); print_mesh_bed_leveling_table();
|
|
|
+ SERIAL_ECHOPGM("G28, final "); print_world_coordinates();
|
|
|
+ SERIAL_ECHOPGM("G28, final "); print_physical_coordinates();
|
|
|
+ SERIAL_ECHOPGM("G28, final "); print_mesh_bed_leveling_table();
|
|
|
#endif
|
|
|
- break;
|
|
|
+ break;
|
|
|
}
|
|
|
#ifdef ENABLE_AUTO_BED_LEVELING
|
|
|
case 29:
|