Scott Lahteine 9 years ago
parent
commit
7b2fadd598
2 changed files with 6 additions and 4 deletions
  1. 5
    3
      Marlin/Marlin_main.cpp
  2. 1
    1
      Marlin/temperature.cpp

+ 5
- 3
Marlin/Marlin_main.cpp View File

@@ -4286,7 +4286,7 @@ inline void gcode_M42() {
4286 4286
 
4287 4287
     randomSeed(millis());
4288 4288
 
4289
-    double mean, sigma, sample_set[n_samples];
4289
+    double mean = 0, sigma = 0, sample_set[n_samples];
4290 4290
     for (uint8_t n = 0; n < n_samples; n++) {
4291 4291
       if (n_legs) {
4292 4292
         int dir = (random(0, 10) > 5.0) ? -1 : 1;  // clockwise or counter clockwise
@@ -4410,8 +4410,10 @@ inline void gcode_M42() {
4410 4410
 
4411 4411
       // Raise before the next loop for the legs,
4412 4412
       // or do the final raise after the last probe
4413
-      if (n_legs || last_probe) {
4414
-        do_probe_raise(last_probe ? Z_RAISE_AFTER_PROBING : z_between);
4413
+      if (last_probe)
4414
+        do_probe_raise(Z_RAISE_AFTER_PROBING);
4415
+      else if (n_legs) {
4416
+        do_probe_raise(z_between);
4415 4417
         if (!last_probe) delay(500);
4416 4418
       }
4417 4419
 

+ 1
- 1
Marlin/temperature.cpp View File

@@ -462,7 +462,7 @@ int Temperature::getHeaterPower(int heater) {
462 462
       EXTRUDER_3_AUTO_FAN_PIN == EXTRUDER_2_AUTO_FAN_PIN ? 2 : 3
463 463
     };
464 464
     uint8_t fanState = 0;
465
-    for (int f = 0; f <= HOTENDS; f++) {
465
+    for (int f = 0; f < HOTENDS; f++) {
466 466
       if (current_temperature[f] > EXTRUDER_AUTO_FAN_TEMPERATURE)
467 467
         SBI(fanState, fanBit[f]);
468 468
     }

Loading…
Cancel
Save