Browse Source

Minor cleanup of the new FAN_KICKSTART code. #334

daid303 12 years ago
parent
commit
0f3f5d083d
2 changed files with 19 additions and 19 deletions
  1. 2
    2
      Marlin/Configuration_adv.h
  2. 17
    17
      Marlin/planner.cpp

+ 2
- 2
Marlin/Configuration_adv.h View File

@@ -68,8 +68,8 @@
68 68
 
69 69
 // When first starting the main fan, run it at full speed for the
70 70
 // given number of milliseconds.  This gets the fan spinning reliably
71
-// before setting a PWM value.  Set to zero to disable.
72
-#define FAN_KICKSTART_TIME 100
71
+// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
72
+//#define FAN_KICKSTART_TIME 100
73 73
 
74 74
 //===========================================================================
75 75
 //=============================Mechanical Settings===========================

+ 17
- 17
Marlin/planner.cpp View File

@@ -466,23 +466,23 @@ void check_axes_activity()
466 466
   }
467 467
 #if FAN_PIN > -1
468 468
   #ifndef FAN_SOFT_PWM
469
-  if (FAN_KICKSTART_TIME) {
470
-    static unsigned long FanKickEnd;
471
-    if (tail_fan_speed) {
472
-      if (FanKickEnd == 0) {
473
-        // Just starting up fan - run at full power.
474
-        FanKickEnd = millis() + FAN_KICKSTART_TIME;
475
-        tail_fan_speed = 255;
476
-      } else if (FanKickEnd > millis())
477
-        // Fan still spinning up.
478
-        tail_fan_speed = 255;
479
-    } else {
480
-      FanKickEnd = 0;
481
-    }
482
-  }
483
-  analogWrite(FAN_PIN,tail_fan_speed);
484
-  #endif
485
-#endif
469
+    #ifdef FAN_KICKSTART_TIME
470
+      static unsigned long fan_kick_end;
471
+      if (tail_fan_speed) {
472
+        if (fan_kick_end == 0) {
473
+          // Just starting up fan - run at full power.
474
+          fan_kick_end = millis() + FAN_KICKSTART_TIME;
475
+          tail_fan_speed = 255;
476
+        } else if (fan_kick_end > millis())
477
+          // Fan still spinning up.
478
+          tail_fan_speed = 255;
479
+      } else {
480
+        fan_kick_end = 0;
481
+      }
482
+    #endif//FAN_KICKSTART_TIME
483
+    analogWrite(FAN_PIN,tail_fan_speed);
484
+  #endif//!FAN_SOFT_PWM
485
+#endif//FAN_PIN > -1
486 486
 #ifdef AUTOTEMP
487 487
   getHighESpeed();
488 488
 #endif

Loading…
Cancel
Save