File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 538538//#define USE_CONTROLLER_FAN
539539#if ENABLED (USE_CONTROLLER_FAN )
540540 //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan
541+ //#define CONTROLLER_FAN2_PIN -1 // Set a custom pin for second controller fan
541542 //#define CONTROLLER_FAN_USE_Z_ONLY // With this option only the Z axis is considered
542543 //#define CONTROLLER_FAN_IGNORE_Z // Ignore Z stepper. Useful when stepper timeout is disabled.
543544 #define CONTROLLERFAN_SPEED_MIN 0 // (0-255) Minimum speed. (If set below this value the fan is turned off.)
Original file line number Diff line number Diff line change @@ -40,6 +40,9 @@ uint8_t ControllerFan::speed;
4040
4141void ControllerFan::setup () {
4242 SET_OUTPUT (CONTROLLER_FAN_PIN);
43+ #ifdef CONTROLLER_FAN2_PIN
44+ SET_OUTPUT (CONTROLLER_FAN2_PIN);
45+ #endif
4346 init ();
4447}
4548
@@ -95,6 +98,13 @@ void ControllerFan::update() {
9598 hal.set_pwm_duty (pin_t (CONTROLLER_FAN_PIN), speed);
9699 else
97100 WRITE (CONTROLLER_FAN_PIN, speed > 0 );
101+
102+ #ifdef CONTROLLER_FAN2_PIN
103+ if (PWM_PIN (CONTROLLER_FAN2_PIN))
104+ hal.set_pwm_duty (pin_t (CONTROLLER_FAN2_PIN), speed);
105+ else
106+ WRITE (CONTROLLER_FAN2_PIN, speed > 0 );
107+ #endif
98108 #endif
99109 }
100110}
You can’t perform that action at this time.
0 commit comments