Przeglądaj źródła

Merge pull request #3771 from thinkyhead/rc_auto_fans_again

Fix checkExtruderAutoFans
Scott Lahteine 8 lat temu
rodzic
commit
26b4cb5b42
1 zmienionych plików z 4 dodań i 2 usunięć
  1. 4
    2
      Marlin/temperature.cpp

+ 4
- 2
Marlin/temperature.cpp Wyświetl plik

@@ -346,13 +346,15 @@ int Temperature::getHeaterPower(int heater) {
346 346
       if (current_temperature[f] > EXTRUDER_AUTO_FAN_TEMPERATURE)
347 347
         SBI(fanState, fanBit[f]);
348 348
     }
349
+    uint8_t fanDone = 0;
349 350
     for (int f = 0; f <= 3; f++) {
350 351
       int8_t pin = fanPin[f];
351
-      if (pin >= 0) {
352
-        unsigned char newFanSpeed = TEST(fanState, f) ? EXTRUDER_AUTO_FAN_SPEED : 0;
352
+      if (pin >= 0 && !TEST(fanDone, fanBit[f])) {
353
+        unsigned char newFanSpeed = TEST(fanState, fanBit[f]) ? EXTRUDER_AUTO_FAN_SPEED : 0;
353 354
         // this idiom allows both digital and PWM fan outputs (see M42 handling).
354 355
         digitalWrite(pin, newFanSpeed);
355 356
         analogWrite(pin, newFanSpeed);
357
+        SBI(fanDone, fanBit[f]);
356 358
       }
357 359
     }
358 360
   }

Ładowanie…
Anuluj
Zapisz