Fix compiler warnings sketch/mesh_bed_calibration.cpp:150:21: warning: unused parameter 'npts' [-Wunused-parameter]
sketch/mesh_bed_calibration.cpp:172:21: warning: unused parameter 'npts' [-Wunused-parameter]
This commit is contained in:
parent
e9d8ed8599
commit
aa0f1fd80b
1 changed files with 9 additions and 9 deletions
|
@ -147,7 +147,7 @@ static inline bool point_on_1st_row(const uint8_t i)
|
||||||
// The first row of points may not be fully reachable
|
// The first row of points may not be fully reachable
|
||||||
// and the y values may be shortened a bit by the bed carriage
|
// and the y values may be shortened a bit by the bed carriage
|
||||||
// pulling the belt up.
|
// pulling the belt up.
|
||||||
static inline float point_weight_x(const uint8_t i, const uint8_t npts, const float &y)
|
static inline float point_weight_x(const uint8_t i, const float &y)
|
||||||
{
|
{
|
||||||
float w = 1.f;
|
float w = 1.f;
|
||||||
if (point_on_1st_row(i)) {
|
if (point_on_1st_row(i)) {
|
||||||
|
@ -169,7 +169,7 @@ static inline float point_weight_x(const uint8_t i, const uint8_t npts, const fl
|
||||||
// The first row of points may not be fully reachable
|
// The first row of points may not be fully reachable
|
||||||
// and the y values may be shortened a bit by the bed carriage
|
// and the y values may be shortened a bit by the bed carriage
|
||||||
// pulling the belt up.
|
// pulling the belt up.
|
||||||
static inline float point_weight_y(const uint8_t i, const uint8_t npts, const float &y)
|
static inline float point_weight_y(const uint8_t i, const float &y)
|
||||||
{
|
{
|
||||||
float w = 1.f;
|
float w = 1.f;
|
||||||
if (point_on_1st_row(i)) {
|
if (point_on_1st_row(i)) {
|
||||||
|
@ -294,7 +294,7 @@ BedSkewOffsetDetectionResultType calculate_machine_skew_and_offset_LS(
|
||||||
(c == 0) ? 1.f :
|
(c == 0) ? 1.f :
|
||||||
((c == 2) ? (-s1 * measured_pts[2 * i]) :
|
((c == 2) ? (-s1 * measured_pts[2 * i]) :
|
||||||
(-c2 * measured_pts[2 * i + 1]));
|
(-c2 * measured_pts[2 * i + 1]));
|
||||||
float w = point_weight_x(i, npts, measured_pts[2 * i + 1]);
|
float w = point_weight_x(i, measured_pts[2 * i + 1]);
|
||||||
acc += a * b * w;
|
acc += a * b * w;
|
||||||
}
|
}
|
||||||
// Second for the residuum in the y axis.
|
// Second for the residuum in the y axis.
|
||||||
|
@ -309,7 +309,7 @@ BedSkewOffsetDetectionResultType calculate_machine_skew_and_offset_LS(
|
||||||
(c == 1) ? 1.f :
|
(c == 1) ? 1.f :
|
||||||
((c == 2) ? ( c1 * measured_pts[2 * i]) :
|
((c == 2) ? ( c1 * measured_pts[2 * i]) :
|
||||||
(-s2 * measured_pts[2 * i + 1]));
|
(-s2 * measured_pts[2 * i + 1]));
|
||||||
float w = point_weight_y(i, npts, measured_pts[2 * i + 1]);
|
float w = point_weight_y(i, measured_pts[2 * i + 1]);
|
||||||
acc += a * b * w;
|
acc += a * b * w;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -325,7 +325,7 @@ BedSkewOffsetDetectionResultType calculate_machine_skew_and_offset_LS(
|
||||||
((r == 2) ? (-s1 * measured_pts[2 * i]) :
|
((r == 2) ? (-s1 * measured_pts[2 * i]) :
|
||||||
(-c2 * measured_pts[2 * i + 1])));
|
(-c2 * measured_pts[2 * i + 1])));
|
||||||
float fx = c1 * measured_pts[2 * i] - s2 * measured_pts[2 * i + 1] + cntr[0] - pgm_read_float(true_pts + i * 2);
|
float fx = c1 * measured_pts[2 * i] - s2 * measured_pts[2 * i + 1] + cntr[0] - pgm_read_float(true_pts + i * 2);
|
||||||
float w = point_weight_x(i, npts, measured_pts[2 * i + 1]);
|
float w = point_weight_x(i, measured_pts[2 * i + 1]);
|
||||||
acc += j * fx * w;
|
acc += j * fx * w;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
@ -335,7 +335,7 @@ BedSkewOffsetDetectionResultType calculate_machine_skew_and_offset_LS(
|
||||||
((r == 2) ? ( c1 * measured_pts[2 * i]) :
|
((r == 2) ? ( c1 * measured_pts[2 * i]) :
|
||||||
(-s2 * measured_pts[2 * i + 1])));
|
(-s2 * measured_pts[2 * i + 1])));
|
||||||
float fy = s1 * measured_pts[2 * i] + c2 * measured_pts[2 * i + 1] + cntr[1] - pgm_read_float(true_pts + i * 2 + 1);
|
float fy = s1 * measured_pts[2 * i] + c2 * measured_pts[2 * i + 1] + cntr[1] - pgm_read_float(true_pts + i * 2 + 1);
|
||||||
float w = point_weight_y(i, npts, measured_pts[2 * i + 1]);
|
float w = point_weight_y(i, measured_pts[2 * i + 1]);
|
||||||
acc += j * fy * w;
|
acc += j * fy * w;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -456,7 +456,7 @@ BedSkewOffsetDetectionResultType calculate_machine_skew_and_offset_LS(
|
||||||
#ifdef SUPPORT_VERBOSITY
|
#ifdef SUPPORT_VERBOSITY
|
||||||
if(verbosity_level >= 20) SERIAL_ECHOPGM("Point on first row");
|
if(verbosity_level >= 20) SERIAL_ECHOPGM("Point on first row");
|
||||||
#endif // SUPPORT_VERBOSITY
|
#endif // SUPPORT_VERBOSITY
|
||||||
float w = point_weight_y(i, npts, measured_pts[2 * i + 1]);
|
float w = point_weight_y(i, measured_pts[2 * i + 1]);
|
||||||
if (sqrt(errX) > BED_CALIBRATION_POINT_OFFSET_MAX_1ST_ROW_X ||
|
if (sqrt(errX) > BED_CALIBRATION_POINT_OFFSET_MAX_1ST_ROW_X ||
|
||||||
(w != 0.f && sqrt(errY) > BED_CALIBRATION_POINT_OFFSET_MAX_1ST_ROW_Y)) {
|
(w != 0.f && sqrt(errY) > BED_CALIBRATION_POINT_OFFSET_MAX_1ST_ROW_Y)) {
|
||||||
result = BED_SKEW_OFFSET_DETECTION_FITTING_FAILED;
|
result = BED_SKEW_OFFSET_DETECTION_FITTING_FAILED;
|
||||||
|
@ -553,7 +553,7 @@ BedSkewOffsetDetectionResultType calculate_machine_skew_and_offset_LS(
|
||||||
for (int8_t i = 0; i < npts; ++ i) {
|
for (int8_t i = 0; i < npts; ++ i) {
|
||||||
float x = vec_x[0] * measured_pts[i * 2] + vec_y[0] * measured_pts[i * 2 + 1];
|
float x = vec_x[0] * measured_pts[i * 2] + vec_y[0] * measured_pts[i * 2 + 1];
|
||||||
float y = vec_x[1] * measured_pts[i * 2] + vec_y[1] * measured_pts[i * 2 + 1];
|
float y = vec_x[1] * measured_pts[i * 2] + vec_y[1] * measured_pts[i * 2 + 1];
|
||||||
float w = point_weight_x(i, npts, y);
|
float w = point_weight_x(i, y);
|
||||||
cntr[0] += w * (pgm_read_float(true_pts + i * 2) - x);
|
cntr[0] += w * (pgm_read_float(true_pts + i * 2) - x);
|
||||||
wx += w;
|
wx += w;
|
||||||
#ifdef SUPPORT_VERBOSITY
|
#ifdef SUPPORT_VERBOSITY
|
||||||
|
@ -570,7 +570,7 @@ BedSkewOffsetDetectionResultType calculate_machine_skew_and_offset_LS(
|
||||||
MYSERIAL.print(wx);
|
MYSERIAL.print(wx);
|
||||||
}
|
}
|
||||||
#endif // SUPPORT_VERBOSITY
|
#endif // SUPPORT_VERBOSITY
|
||||||
w = point_weight_y(i, npts, y);
|
w = point_weight_y(i, y);
|
||||||
cntr[1] += w * (pgm_read_float(true_pts + i * 2 + 1) - y);
|
cntr[1] += w * (pgm_read_float(true_pts + i * 2 + 1) - y);
|
||||||
wy += w;
|
wy += w;
|
||||||
#ifdef SUPPORT_VERBOSITY
|
#ifdef SUPPORT_VERBOSITY
|
||||||
|
|
Loading…
Reference in a new issue