Browse Source

Add CONTROLLER_FAN_IGNORE_Z (#18735)

InsanityAutomation 3 years ago
parent
commit
2c61e6ba28
No account linked to committer's email address

+ 1
- 0
Marlin/Configuration_adv.h View File

@@ -375,6 +375,7 @@
375 375
 #if ENABLED(USE_CONTROLLER_FAN)
376 376
   //#define CONTROLLER_FAN_PIN -1        // Set a custom pin for the controller fan
377 377
   //#define CONTROLLER_FAN_USE_Z_ONLY    // With this option only the Z axis is considered
378
+  //#define CONTROLLER_FAN_IGNORE_Z      // Ignore Z stepper. Useful when stepper timeout is disabled.
378 379
   #define CONTROLLERFAN_SPEED_MIN      0 // (0-255) Minimum speed. (If set below this value the fan is turned off.)
379 380
   #define CONTROLLERFAN_SPEED_ACTIVE 255 // (0-255) Active speed, used when any motor is enabled
380 381
   #define CONTROLLERFAN_SPEED_IDLE     0 // (0-255) Idle speed, used when motors are disabled

+ 13
- 19
Marlin/src/feature/controllerfan.cpp View File

@@ -55,30 +55,24 @@ void ControllerFan::update() {
55 55
     #define MOTOR_IS_ON(A,B) (A##_ENABLE_READ() == bool(B##_ENABLE_ON))
56 56
     #define _OR_ENABLED_E(N) || MOTOR_IS_ON(E##N,E)
57 57
 
58
-    const bool motor_on = MOTOR_IS_ON(Z,Z)
59
-      #if HAS_Z2_ENABLE
60
-        || MOTOR_IS_ON(Z2,Z)
61
-      #endif
62
-      #if HAS_Z3_ENABLE
63
-        || MOTOR_IS_ON(Z3,Z)
64
-      #endif
65
-      #if HAS_Z4_ENABLE
66
-        || MOTOR_IS_ON(Z4,Z)
67
-      #endif
68
-      || (DISABLED(CONTROLLER_FAN_USE_Z_ONLY) && (
69
-          MOTOR_IS_ON(X,X) || MOTOR_IS_ON(Y,Y)
70
-          #if HAS_X2_ENABLE
71
-            || MOTOR_IS_ON(X2,X)
72
-          #endif
73
-          #if HAS_Y2_ENABLE
74
-            || MOTOR_IS_ON(Y2,Y)
75
-          #endif
58
+    const bool motor_on = (
59
+      ( DISABLED(CONTROLLER_FAN_IGNORE_Z) &&
60
+        (    MOTOR_IS_ON(Z,Z)
61
+          || TERN0(HAS_Z2_ENABLE, MOTOR_IS_ON(Z2,Z))
62
+          || TERN0(HAS_Z3_ENABLE, MOTOR_IS_ON(Z3,Z))
63
+          || TERN0(HAS_Z4_ENABLE, MOTOR_IS_ON(Z4,Z))
64
+        )
65
+      ) || (
66
+        DISABLED(CONTROLLER_FAN_USE_Z_ONLY) &&
67
+        (    MOTOR_IS_ON(X,X) || MOTOR_IS_ON(Y,Y)
68
+          || TERN0(HAS_X2_ENABLE, MOTOR_IS_ON(X2,X))
69
+          || TERN0(HAS_Y2_ENABLE, MOTOR_IS_ON(Y2,Y))
76 70
           #if E_STEPPERS
77 71
             REPEAT(E_STEPPERS, _OR_ENABLED_E)
78 72
           #endif
79 73
         )
80 74
       )
81
-    ;
75
+    );
82 76
 
83 77
     // If any of the drivers or the heated bed are enabled...
84 78
     if (motor_on || TERN0(HAS_HEATED_BED, thermalManager.temp_bed.soft_pwm_amount > 0))

+ 1
- 1
Marlin/src/feature/mmu2/mmu2.cpp View File

@@ -466,7 +466,7 @@ void MMU2::check_version() {
466 466
   }
467 467
 }
468 468
 
469
-static bool mmu2_not_responding() {
469
+static void mmu2_not_responding() {
470 470
   LCD_MESSAGEPGM(MSG_MMU2_NOT_RESPONDING);
471 471
   BUZZ(100, 659);
472 472
   BUZZ(200, 698);

+ 4
- 0
Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h View File

@@ -197,6 +197,10 @@
197 197
   #endif
198 198
 #endif
199 199
 
200
+#ifndef CONTROLLER_FAN_PIN
201
+  #define CONTROLLER_FAN_PIN         EX2_FAN_PIN
202
+#endif
203
+
200 204
 //
201 205
 // Misc. Functions
202 206
 //

+ 4
- 2
buildroot/tests/mega2560-tests View File

@@ -103,7 +103,8 @@ exec_test $1 $2 "MEGACONTROLLER | Minipanel | M100 | PWM_MOTOR_CURRENT | PRINTCO
103 103
 restore_configs
104 104
 opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO
105 105
 opt_set LCD_LANGUAGE el_gr
106
-opt_enable MIXING_EXTRUDER GRADIENT_MIX GRADIENT_VTOOL CR10_STOCKDISPLAY
106
+opt_enable MIXING_EXTRUDER GRADIENT_MIX GRADIENT_VTOOL CR10_STOCKDISPLAY \
107
+           USE_CONTROLLER_FAN CONTROLLER_FAN_EDITABLE CONTROLLER_FAN_IGNORE_Z
107 108
 opt_set MIXING_STEPPERS 5
108 109
 opt_set LCD_LANGUAGE ru
109 110
 exec_test $1 $2 "Azteeg X3 | Mixing Extruder (x5) | Gradient Mix | Greek"
@@ -141,7 +142,8 @@ opt_enable COREYX USE_XMAX_PLUG MIXING_EXTRUDER GRADIENT_MIX \
141 142
            FIX_MOUNTED_PROBE AUTO_BED_LEVELING_LINEAR DEBUG_LEVELING_FEATURE FILAMENT_WIDTH_SENSOR \
142 143
            Z_SAFE_HOMING SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER \
143 144
            SD_ABORT_ON_ENDSTOP_HIT HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT ADVANCED_OK M114_DETAIL \
144
-           VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS EXTRA_FAN_SPEED FWRETRACT
145
+           VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS EXTRA_FAN_SPEED FWRETRACT \
146
+           USE_CONTROLLER_FAN CONTROLLER_FAN_EDITABLE CONTROLLER_FAN_USE_Z_ONLY
145 147
 opt_set FAN_MIN_PWM 50
146 148
 opt_set FAN_KICKSTART_TIME 100
147 149
 opt_set XY_FREQUENCY_LIMIT 15

Loading…
Cancel
Save