Преглед на файлове

Merge pull request #11653 from neorex/add_support_E4

[2.0.x] Fix 5 mixing steppers
Scott Lahteine преди 6 години
родител
ревизия
199613a416
No account linked to committer's email address
променени са 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,7 +80,10 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
80 80
   /**
81 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 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 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 89
   #elif MIXING_STEPPERS > 2

+ 19
- 11
Marlin/src/feature/controllerfan.cpp Целия файл

@@ -35,26 +35,34 @@ void controllerfan_update() {
35 35
   const millis_t ms = millis();
36 36
   if (ELAPSED(ms, nextMotorCheck)) {
37 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 40
     if (X_ENABLE_READ == X_ENABLE_ON || Y_ENABLE_READ == Y_ENABLE_ON || Z_ENABLE_READ == Z_ENABLE_ON
39 41
       #if HAS_HEATED_BED
40 42
         || thermalManager.soft_pwm_amount_bed > 0
41 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 54
         #if E_STEPPERS > 1
44 55
           || E1_ENABLE_READ == E_ENABLE_ON
45
-          #if HAS_X2_ENABLE
46
-            || X2_ENABLE_READ == X_ENABLE_ON
47
-          #endif
48 56
           #if E_STEPPERS > 2
49
-            || E2_ENABLE_READ == E_ENABLE_ON
57
+              || E2_ENABLE_READ == E_ENABLE_ON
50 58
             #if E_STEPPERS > 3
51
-              || E3_ENABLE_READ == E_ENABLE_ON
59
+                || E3_ENABLE_READ == E_ENABLE_ON
52 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 67
       lastMotorOn = ms; //... set time to NOW so the fan will turn on
60 68
     }

+ 14
- 4
Marlin/src/feature/power.cpp Целия файл

@@ -50,20 +50,30 @@ bool Power::is_power_needed() {
50 50
     if (controllerFanSpeed > 0) return true;
51 51
   #endif
52 52
 
53
+  // If any of the drivers or the bed are enabled...
53 54
   if (X_ENABLE_READ == X_ENABLE_ON || Y_ENABLE_READ == Y_ENABLE_ON || Z_ENABLE_READ == Z_ENABLE_ON
54 55
     #if HAS_HEATED_BED
55 56
       || thermalManager.soft_pwm_amount_bed > 0
56 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 68
       #if E_STEPPERS > 1
59 69
         || E1_ENABLE_READ == E_ENABLE_ON
60
-        #if HAS_X2_ENABLE
61
-          || X2_ENABLE_READ == X_ENABLE_ON
62
-        #endif
63 70
         #if E_STEPPERS > 2
64 71
             || E2_ENABLE_READ == E_ENABLE_ON
65 72
           #if E_STEPPERS > 3
66 73
               || E3_ENABLE_READ == E_ENABLE_ON
74
+            #if E_STEPPERS > 4
75
+                || E4_ENABLE_READ == E_ENABLE_ON
76
+            #endif
67 77
           #endif
68 78
         #endif
69 79
       #endif

Loading…
Отказ
Запис