瀏覽代碼

Merge pull request #11653 from neorex/add_support_E4

[2.0.x] Fix 5 mixing steppers
Scott Lahteine 6 年之前
父節點
當前提交
199613a416
沒有連結到貢獻者的電子郵件帳戶。
共有 3 個檔案被更改,包括 37 行新增16 行删除
  1. 4
    1
      Marlin/src/Marlin.h
  2. 19
    11
      Marlin/src/feature/controllerfan.cpp
  3. 14
    4
      Marlin/src/feature/power.cpp

+ 4
- 1
Marlin/src/Marlin.h 查看文件

80
   /**
80
   /**
81
    * Mixing steppers synchronize their enable (and direction) together
81
    * Mixing steppers synchronize their enable (and direction) together
82
    */
82
    */
83
-  #if MIXING_STEPPERS > 3
83
+  #if MIXING_STEPPERS > 4
84
+    #define  enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); E4_ENABLE_WRITE( E_ENABLE_ON); }
85
+    #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); E4_ENABLE_WRITE(!E_ENABLE_ON); }
86
+  #elif MIXING_STEPPERS > 3
84
     #define  enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); }
87
     #define  enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); }
85
     #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); }
88
     #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); }
86
   #elif MIXING_STEPPERS > 2
89
   #elif MIXING_STEPPERS > 2

+ 19
- 11
Marlin/src/feature/controllerfan.cpp 查看文件

35
   const millis_t ms = millis();
35
   const millis_t ms = millis();
36
   if (ELAPSED(ms, nextMotorCheck)) {
36
   if (ELAPSED(ms, nextMotorCheck)) {
37
     nextMotorCheck = ms + 2500UL; // Not a time critical function, so only check every 2.5s
37
     nextMotorCheck = ms + 2500UL; // Not a time critical function, so only check every 2.5s
38
+
39
+    // If any of the drivers or the bed are enabled...
38
     if (X_ENABLE_READ == X_ENABLE_ON || Y_ENABLE_READ == Y_ENABLE_ON || Z_ENABLE_READ == Z_ENABLE_ON
40
     if (X_ENABLE_READ == X_ENABLE_ON || Y_ENABLE_READ == Y_ENABLE_ON || Z_ENABLE_READ == Z_ENABLE_ON
39
       #if HAS_HEATED_BED
41
       #if HAS_HEATED_BED
40
         || thermalManager.soft_pwm_amount_bed > 0
42
         || thermalManager.soft_pwm_amount_bed > 0
41
       #endif
43
       #endif
42
-        || E0_ENABLE_READ == E_ENABLE_ON // If any of the drivers are enabled...
44
+        #if HAS_X2_ENABLE
45
+          || X2_ENABLE_READ == X_ENABLE_ON
46
+        #endif
47
+        #if HAS_Y2_ENABLE
48
+          || Y2_ENABLE_READ == Y_ENABLE_ON
49
+        #endif
50
+        #if HAS_Z2_ENABLE
51
+          || Z2_ENABLE_READ == Z_ENABLE_ON
52
+        #endif
53
+        || E0_ENABLE_READ == E_ENABLE_ON
43
         #if E_STEPPERS > 1
54
         #if E_STEPPERS > 1
44
           || E1_ENABLE_READ == E_ENABLE_ON
55
           || E1_ENABLE_READ == E_ENABLE_ON
45
-          #if HAS_X2_ENABLE
46
-            || X2_ENABLE_READ == X_ENABLE_ON
47
-          #endif
48
           #if E_STEPPERS > 2
56
           #if E_STEPPERS > 2
49
-            || E2_ENABLE_READ == E_ENABLE_ON
57
+              || E2_ENABLE_READ == E_ENABLE_ON
50
             #if E_STEPPERS > 3
58
             #if E_STEPPERS > 3
51
-              || E3_ENABLE_READ == E_ENABLE_ON
59
+                || E3_ENABLE_READ == E_ENABLE_ON
52
               #if E_STEPPERS > 4
60
               #if E_STEPPERS > 4
53
-                || E4_ENABLE_READ == E_ENABLE_ON
54
-              #endif // E_STEPPERS > 4
55
-            #endif // E_STEPPERS > 3
56
-          #endif // E_STEPPERS > 2
57
-        #endif // E_STEPPERS > 1
61
+                  || E4_ENABLE_READ == E_ENABLE_ON
62
+              #endif
63
+            #endif
64
+          #endif
65
+        #endif
58
     ) {
66
     ) {
59
       lastMotorOn = ms; //... set time to NOW so the fan will turn on
67
       lastMotorOn = ms; //... set time to NOW so the fan will turn on
60
     }
68
     }

+ 14
- 4
Marlin/src/feature/power.cpp 查看文件

50
     if (controllerFanSpeed > 0) return true;
50
     if (controllerFanSpeed > 0) return true;
51
   #endif
51
   #endif
52
 
52
 
53
+  // If any of the drivers or the bed are enabled...
53
   if (X_ENABLE_READ == X_ENABLE_ON || Y_ENABLE_READ == Y_ENABLE_ON || Z_ENABLE_READ == Z_ENABLE_ON
54
   if (X_ENABLE_READ == X_ENABLE_ON || Y_ENABLE_READ == Y_ENABLE_ON || Z_ENABLE_READ == Z_ENABLE_ON
54
     #if HAS_HEATED_BED
55
     #if HAS_HEATED_BED
55
       || thermalManager.soft_pwm_amount_bed > 0
56
       || thermalManager.soft_pwm_amount_bed > 0
56
     #endif
57
     #endif
57
-      || E0_ENABLE_READ == E_ENABLE_ON // If any of the drivers are enabled...
58
+      #if HAS_X2_ENABLE
59
+        || X2_ENABLE_READ == X_ENABLE_ON
60
+      #endif
61
+      #if HAS_Y2_ENABLE
62
+        || Y2_ENABLE_READ == Y_ENABLE_ON
63
+      #endif
64
+      #if HAS_Z2_ENABLE
65
+        || Z2_ENABLE_READ == Z_ENABLE_ON
66
+      #endif
67
+      || E0_ENABLE_READ == E_ENABLE_ON
58
       #if E_STEPPERS > 1
68
       #if E_STEPPERS > 1
59
         || E1_ENABLE_READ == E_ENABLE_ON
69
         || E1_ENABLE_READ == E_ENABLE_ON
60
-        #if HAS_X2_ENABLE
61
-          || X2_ENABLE_READ == X_ENABLE_ON
62
-        #endif
63
         #if E_STEPPERS > 2
70
         #if E_STEPPERS > 2
64
             || E2_ENABLE_READ == E_ENABLE_ON
71
             || E2_ENABLE_READ == E_ENABLE_ON
65
           #if E_STEPPERS > 3
72
           #if E_STEPPERS > 3
66
               || E3_ENABLE_READ == E_ENABLE_ON
73
               || E3_ENABLE_READ == E_ENABLE_ON
74
+            #if E_STEPPERS > 4
75
+                || E4_ENABLE_READ == E_ENABLE_ON
76
+            #endif
67
           #endif
77
           #endif
68
         #endif
78
         #endif
69
       #endif
79
       #endif

Loading…
取消
儲存