Alignment, comments

This commit is contained in:
espr14 2021-01-11 15:40:12 +01:00
parent 2981b9e9c5
commit 2e40a27460
1 changed files with 97 additions and 93 deletions

View File

@ -2301,7 +2301,7 @@ BedSkewOffsetDetectionResultType find_bed_offset_and_skew(int8_t verbosity_level
delay_keep_alive(3000); delay_keep_alive(3000);
#endif // SUPPORT_VERBOSITY #endif // SUPPORT_VERBOSITY
if (!find_bed_induction_sensor_point_xy(verbosity_level)) if (!find_bed_induction_sensor_point_xy(verbosity_level))
return BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND; return BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND
#ifndef NEW_XYZCAL #ifndef NEW_XYZCAL
#ifndef HEATBED_V2 #ifndef HEATBED_V2
@ -2376,6 +2376,7 @@ BedSkewOffsetDetectionResultType find_bed_offset_and_skew(int8_t verbosity_level
} }
#endif // SUPPORT_VERBOSITY #endif // SUPPORT_VERBOSITY
} }
DBG(_n("All 4 calibration points found.\n"));
delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity
#ifdef SUPPORT_VERBOSITY #ifdef SUPPORT_VERBOSITY
@ -2386,7 +2387,7 @@ BedSkewOffsetDetectionResultType find_bed_offset_and_skew(int8_t verbosity_level
// Don't let the manage_inactivity() function remove power from the motors. // Don't let the manage_inactivity() function remove power from the motors.
refresh_cmd_timeout(); refresh_cmd_timeout();
// Go to the measurement point. // Go to the measurement point.
// Use the coorrected coordinate, which is a result of find_bed_offset_and_skew(). // Use the corrected coordinate, which is a result of find_bed_offset_and_skew().
current_position[X_AXIS] = pts[mesh_point * 2]; current_position[X_AXIS] = pts[mesh_point * 2];
current_position[Y_AXIS] = pts[mesh_point * 2 + 1]; current_position[Y_AXIS] = pts[mesh_point * 2 + 1];
go_to_current(homing_feedrate[X_AXIS] / 60); go_to_current(homing_feedrate[X_AXIS] / 60);
@ -2450,7 +2451,7 @@ BedSkewOffsetDetectionResultType find_bed_offset_and_skew(int8_t verbosity_level
// Don't let the manage_inactivity() function remove power from the motors. // Don't let the manage_inactivity() function remove power from the motors.
refresh_cmd_timeout(); refresh_cmd_timeout();
// Go to the measurement point. // Go to the measurement point.
// Use the coorrected coordinate, which is a result of find_bed_offset_and_skew(). // Use the corrected coordinate, which is a result of find_bed_offset_and_skew().
uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; // from 0 to MESH_NUM_X_POINTS - 1 uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; // from 0 to MESH_NUM_X_POINTS - 1
uint8_t iy = mesh_point / MESH_MEAS_NUM_X_POINTS; uint8_t iy = mesh_point / MESH_MEAS_NUM_X_POINTS;
if (iy & 1) ix = (MESH_MEAS_NUM_X_POINTS - 1) - ix; if (iy & 1) ix = (MESH_MEAS_NUM_X_POINTS - 1) - ix;
@ -2463,7 +2464,10 @@ BedSkewOffsetDetectionResultType find_bed_offset_and_skew(int8_t verbosity_level
#endif // SUPPORT_VERBOSITY #endif // SUPPORT_VERBOSITY
return result; return result;
} }
if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2) return result; //if fitting failed and front center point is out of reach, terminate calibration and inform user if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){
DBG(_n("Calibration failed.\n"));
return result; //if fitting failed and front center point is out of reach, terminate calibration and inform user
}
iteration++; iteration++;
} }
return result; return result;