|
@@ -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
|