|
@@ -27,6 +27,8 @@
|
27
|
27
|
#include "../module/stepper_indirection.h"
|
28
|
28
|
#include "../module/temperature.h"
|
29
|
29
|
|
|
30
|
+uint8_t controllerFanSpeed;
|
|
31
|
+
|
30
|
32
|
void controllerfan_update() {
|
31
|
33
|
static millis_t lastMotorOn = 0, // Last time a motor was turned on
|
32
|
34
|
nextMotorCheck = 0; // Last time the state was checked
|
|
@@ -56,6 +58,7 @@ void controllerfan_update() {
|
56
|
58
|
|
57
|
59
|
// Fan off if no steppers have been enabled for CONTROLLERFAN_SECS seconds
|
58
|
60
|
uint8_t speed = (!lastMotorOn || ELAPSED(ms, lastMotorOn + (CONTROLLERFAN_SECS) * 1000UL)) ? 0 : CONTROLLERFAN_SPEED;
|
|
61
|
+ controllerFanSpeed = speed;
|
59
|
62
|
|
60
|
63
|
// allows digital or PWM fan output to be used (see M42 handling)
|
61
|
64
|
WRITE(CONTROLLER_FAN_PIN, speed);
|