Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Critical Bug: Variable old_tool_index not declared in G33 (The source code does not compile configurations with more than one extruder) #26122

Merged
merged 4 commits into from
Aug 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Marlin/src/gcode/calibrate/G33.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void ac_setup(const bool reset_bed) {
#endif
}

void ac_cleanup(TERN_(HAS_MULTI_HOTEND, const uint8_t old_tool_index)) {
void ac_cleanup() {
TERN_(DELTA_HOME_TO_SAFE_ZONE, do_blocking_move_to_z(delta_clip_start_height));
TERN_(HAS_BED_PROBE, probe.stow());
restore_feedrate_and_scaling();
Expand All @@ -97,7 +97,7 @@ void print_signed_float(FSTR_P const prefix, const_float_t f) {
}

/**
* - Print the delta settings
* - Print the delta settings
*/
static void print_calibration_settings(const bool end_stops, const bool tower_angles) {
SERIAL_ECHOPGM(".Height:", delta_height);
Expand All @@ -123,7 +123,7 @@ static void print_calibration_settings(const bool end_stops, const bool tower_an
}

/**
* - Print the probe results
* - Print the probe results
*/
static void print_calibration_results(const float z_pt[NPP + 1], const bool tower_points, const bool opposite_points) {
SERIAL_ECHOPGM(". ");
Expand All @@ -147,7 +147,7 @@ static void print_calibration_results(const float z_pt[NPP + 1], const bool towe
}

/**
* - Calculate the standard deviation from the zero plane
* - Calculate the standard deviation from the zero plane
*/
static float std_dev_points(float z_pt[NPP + 1], const bool _0p_cal, const bool _1p_cal, const bool _4p_cal, const bool _4p_opp) {
if (!_0p_cal) {
Expand All @@ -165,7 +165,7 @@ static float std_dev_points(float z_pt[NPP + 1], const bool _0p_cal, const bool
}

/**
* - Probe a point
* - Probe a point
*/
static float calibration_probe(const xy_pos_t &xy, const bool stow, const bool probe_at_offset) {
#if HAS_BED_PROBE
Expand All @@ -177,7 +177,7 @@ static float calibration_probe(const xy_pos_t &xy, const bool stow, const bool p
}

/**
* - Probe a grid
* - Probe a grid
*/
static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_points, const float dcr, const bool towers_set, const bool stow_after_each, const bool probe_at_offset) {
const bool _0p_calibration = probe_points == 0,
Expand Down Expand Up @@ -501,7 +501,7 @@ void GcodeSuite::G33() {
zero_std_dev_old = zero_std_dev;
if (!probe_calibration_points(z_at_pt, probe_points, dcr, towers_set, stow_after_each, probe_at_offset)) {
SERIAL_ECHOLNPGM("Correct delta settings with M665 and M666");
return ac_cleanup(TERN_(HAS_MULTI_HOTEND, old_tool_index));
return ac_cleanup();
}
zero_std_dev = std_dev_points(z_at_pt, _0p_calibration, _1p_calibration, _4p_calibration, _4p_opposite_points);

Expand Down Expand Up @@ -678,7 +678,7 @@ void GcodeSuite::G33() {
}
while (((zero_std_dev < test_precision && iterations < 31) || iterations <= force_iterations) && zero_std_dev > calibration_precision);

ac_cleanup(TERN_(HAS_MULTI_HOTEND, old_tool_index));
ac_cleanup();

TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE));
#if HAS_DELTA_SENSORLESS_PROBING
Expand Down
Loading