Explorar el Código

Always init configured fan pins

Scott Lahteine hace 8 años
padre
commit
3a0a94b21a
Se han modificado 1 ficheros con 24 adiciones y 28 borrados
  1. 24
    28
      Marlin/temperature.cpp

+ 24
- 28
Marlin/temperature.cpp Ver fichero

@@ -987,39 +987,35 @@ void Temperature::init() {
987 987
     SET_OUTPUT(HEATER_BED_PIN);
988 988
   #endif
989 989
 
990
-  #if ENABLED(FAST_PWM_FAN) || ENABLED(FAN_SOFT_PWM)
991
-
992
-    #if HAS_FAN0
993
-      SET_OUTPUT(FAN_PIN);
994
-      #if ENABLED(FAST_PWM_FAN)
995
-        setPwmFrequency(FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
996
-      #endif
997
-      #if ENABLED(FAN_SOFT_PWM)
998
-        soft_pwm_fan[0] = fanSpeedSoftPwm[0] / 2;
999
-      #endif
990
+  #if HAS_FAN0
991
+    SET_OUTPUT(FAN_PIN);
992
+    #if ENABLED(FAST_PWM_FAN)
993
+      setPwmFrequency(FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
1000 994
     #endif
1001
-
1002
-    #if HAS_FAN1
1003
-      SET_OUTPUT(FAN1_PIN);
1004
-      #if ENABLED(FAST_PWM_FAN)
1005
-        setPwmFrequency(FAN1_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
1006
-      #endif
1007
-      #if ENABLED(FAN_SOFT_PWM)
1008
-        soft_pwm_fan[1] = fanSpeedSoftPwm[1] / 2;
1009
-      #endif
995
+    #if ENABLED(FAN_SOFT_PWM)
996
+      soft_pwm_fan[0] = fanSpeedSoftPwm[0] / 2;
1010 997
     #endif
998
+  #endif
1011 999
 
1012
-    #if HAS_FAN2
1013
-      SET_OUTPUT(FAN2_PIN);
1014
-      #if ENABLED(FAST_PWM_FAN)
1015
-        setPwmFrequency(FAN2_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
1016
-      #endif
1017
-      #if ENABLED(FAN_SOFT_PWM)
1018
-        soft_pwm_fan[2] = fanSpeedSoftPwm[2] / 2;
1019
-      #endif
1000
+  #if HAS_FAN1
1001
+    SET_OUTPUT(FAN1_PIN);
1002
+    #if ENABLED(FAST_PWM_FAN)
1003
+      setPwmFrequency(FAN1_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
1004
+    #endif
1005
+    #if ENABLED(FAN_SOFT_PWM)
1006
+      soft_pwm_fan[1] = fanSpeedSoftPwm[1] / 2;
1020 1007
     #endif
1008
+  #endif
1021 1009
 
1022
-  #endif // FAST_PWM_FAN || FAN_SOFT_PWM
1010
+  #if HAS_FAN2
1011
+    SET_OUTPUT(FAN2_PIN);
1012
+    #if ENABLED(FAST_PWM_FAN)
1013
+      setPwmFrequency(FAN2_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
1014
+    #endif
1015
+    #if ENABLED(FAN_SOFT_PWM)
1016
+      soft_pwm_fan[2] = fanSpeedSoftPwm[2] / 2;
1017
+    #endif
1018
+  #endif
1023 1019
 
1024 1020
   #if ENABLED(HEATER_0_USES_MAX6675)
1025 1021
 

Loading…
Cancelar
Guardar