ソースを参照

Configurable number of M106 fans (#18883)

Giuliano Zaro 3年前
コミット
3426c7fc94
コミッターのメールアドレスに関連付けられたアカウントが存在しません

+ 4
- 0
Marlin/Configuration.h ファイルの表示

@@ -2275,6 +2275,10 @@
2275 2275
 
2276 2276
 // @section extras
2277 2277
 
2278
+// Set number of user-controlled fans. Disable to use all board-defined fans.
2279
+// :[1,2,3,4,5,6,7,8]
2280
+//#define NUM_M106_FANS 1
2281
+
2278 2282
 // Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino
2279 2283
 //#define FAST_PWM_FAN
2280 2284
 

+ 19
- 3
Marlin/src/inc/Conditionals_post.h ファイルの表示

@@ -1876,12 +1876,28 @@
1876 1876
   #undef AUTO_POWER_CHAMBER_FAN
1877 1877
 #endif
1878 1878
 
1879
-// Other fans
1879
+// Print Cooling fans (limit)
1880
+#ifdef NUM_M106_FANS
1881
+  #define MAX_FANS NUM_M106_FANS
1882
+#else
1883
+  #define MAX_FANS 8  // Max supported fans
1884
+#endif
1885
+
1886
+#define _NOT_E_AUTO(N,F) (E##N##_AUTO_FAN_PIN != FAN##F##_PIN)
1887
+#define _HAS_FAN(F) (PIN_EXISTS(FAN##F) \
1888
+                     && CONTROLLER_FAN_PIN != FAN##F##_PIN \
1889
+                     && _NOT_E_AUTO(0,F) \
1890
+                     && _NOT_E_AUTO(1,F) \
1891
+                     && _NOT_E_AUTO(2,F) \
1892
+                     && _NOT_E_AUTO(3,F) \
1893
+                     && _NOT_E_AUTO(4,F) \
1894
+                     && _NOT_E_AUTO(5,F) \
1895
+                     && _NOT_E_AUTO(6,F) \
1896
+                     && _NOT_E_AUTO(7,F) \
1897
+                     && F < MAX_FANS)
1880 1898
 #if PIN_EXISTS(FAN)
1881 1899
   #define HAS_FAN0 1
1882 1900
 #endif
1883
-#define _NOT_E_AUTO(N,F) (E##N##_AUTO_FAN_PIN != FAN##F##_PIN)
1884
-#define _HAS_FAN(F) (PIN_EXISTS(FAN##F) && CONTROLLER_FAN_PIN != FAN##F##_PIN && _NOT_E_AUTO(0,F) && _NOT_E_AUTO(1,F) && _NOT_E_AUTO(2,F) && _NOT_E_AUTO(3,F) && _NOT_E_AUTO(4,F) && _NOT_E_AUTO(5,F) && _NOT_E_AUTO(6,F) && _NOT_E_AUTO(7,F))
1885 1901
 #if _HAS_FAN(1)
1886 1902
   #define HAS_FAN1 1
1887 1903
 #endif

+ 7
- 0
Marlin/src/inc/SanityCheck.h ファイルの表示

@@ -1107,6 +1107,13 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1107 1107
 #endif
1108 1108
 
1109 1109
 /**
1110
+ * Limited user-controlled fans
1111
+ */
1112
+#if NUM_M106_FANS > FAN_COUNT
1113
+  #error "The selected board doesn't support enough user-controlled fans. Reduce NUM_M106_FANS."
1114
+#endif
1115
+
1116
+/**
1110 1117
  * Limited number of servos
1111 1118
  */
1112 1119
 #if NUM_SERVOS > NUM_SERVO_PLUGS

+ 1
- 1
Marlin/src/module/temperature.cpp ファイルの表示

@@ -195,7 +195,7 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY,
195 195
   #endif
196 196
 
197 197
   #if ENABLED(ADAPTIVE_FAN_SLOWING)
198
-    uint8_t Temperature::fan_speed_scaler[FAN_COUNT] = ARRAY_N(FAN_COUNT, 128, 128, 128, 128, 128, 128);
198
+    uint8_t Temperature::fan_speed_scaler[FAN_COUNT] = ARRAY_N(FAN_COUNT, 128, 128, 128, 128, 128, 128, 128, 128);
199 199
   #endif
200 200
 
201 201
   /**

+ 1
- 1
Marlin/src/pins/sam/pins_CNCONTROLS_15D.h ファイルの表示

@@ -92,7 +92,7 @@
92 92
 //
93 93
 // Fans
94 94
 //
95
-//#define FAN0_PIN                             8
95
+//#define FAN_PIN                              8
96 96
 
97 97
 //
98 98
 // Auto fans

読み込み中…
キャンセル
保存