Pārlūkot izejas kodu

Simplify sample_set probe_pt call in M48

Scott Lahteine 9 gadus atpakaļ
vecāks
revīzija
46d3ef2223
1 mainītis faili ar 9 papildinājumiem un 9 dzēšanām
  1. 9
    9
      Marlin/Marlin_main.cpp

+ 9
- 9
Marlin/Marlin_main.cpp Parādīt failu

4362
       /**
4362
       /**
4363
        * We don't really have to do this move, but if we don't we can see a
4363
        * We don't really have to do this move, but if we don't we can see a
4364
        * funny shift in the Z Height because the user might not have the
4364
        * funny shift in the Z Height because the user might not have the
4365
-       * Z_RAISE_BEFORE_PROBING height identical to the Z_RAISE_BETWEEN_PROBING
4365
+       * Z_RAISE_BEFORE_PROBING height identical to the Z_RAISE_BETWEEN_PROBINGS
4366
        * height. This gets us back to the probe location at the same height that
4366
        * height. This gets us back to the probe location at the same height that
4367
        * we have been running around the circle at.
4367
        * we have been running around the circle at.
4368
        */
4368
        */
4369
+      bool last_probe = (n == n_samples - 1);
4369
       do_blocking_move_to_xy(X_probe_location - (X_PROBE_OFFSET_FROM_EXTRUDER), Y_probe_location - (Y_PROBE_OFFSET_FROM_EXTRUDER));
4370
       do_blocking_move_to_xy(X_probe_location - (X_PROBE_OFFSET_FROM_EXTRUDER), Y_probe_location - (Y_PROBE_OFFSET_FROM_EXTRUDER));
4370
-      if (deploy_probe_for_each_reading)
4371
-        sample_set[n] = probe_pt(X_probe_location, Y_probe_location, Z_RAISE_BEFORE_PROBING, ProbeDeployAndStow, verbose_level);
4372
-      else {
4373
-        if (n == n_samples - 1)
4374
-          sample_set[n] = probe_pt(X_probe_location, Y_probe_location, Z_RAISE_BEFORE_PROBING, ProbeStow, verbose_level); else
4375
-          sample_set[n] = probe_pt(X_probe_location, Y_probe_location, Z_RAISE_BEFORE_PROBING, ProbeStay, verbose_level);
4376
-      }
4371
+      sample_set[n] = probe_pt(
4372
+        X_probe_location, Y_probe_location,
4373
+        Z_RAISE_BEFORE_PROBING,
4374
+        deploy_probe_for_each_reading ? ProbeDeployAndStow : last_probe ? ProbeStow : ProbeStay,
4375
+        verbose_level
4376
+      );
4377
 
4377
 
4378
       /**
4378
       /**
4379
        * Get the current mean for the data points we have so far
4379
        * Get the current mean for the data points we have so far
4408
       }
4408
       }
4409
       if (verbose_level > 0) SERIAL_EOL;
4409
       if (verbose_level > 0) SERIAL_EOL;
4410
       delay(50);
4410
       delay(50);
4411
-      do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS);
4411
+      do_blocking_move_to_z(current_position[Z_AXIS] + (last_probe ? Z_RAISE_AFTER_PROBING : Z_RAISE_BETWEEN_PROBINGS));
4412
     }  // End of probe loop code
4412
     }  // End of probe loop code
4413
 
4413
 
4414
     if (verbose_level > 0) {
4414
     if (verbose_level > 0) {

Notiek ielāde…
Atcelt
Saglabāt