Bladeren bron

Fixes for DUAL_NOZZLE_DUPLICATION_MODE

Scott Lahteine 7 jaren geleden
bovenliggende
commit
8002672938
2 gewijzigde bestanden met toevoegingen van 25 en 23 verwijderingen
  1. 1
    1
      Marlin/enum.h
  2. 24
    22
      Marlin/planner.cpp

+ 1
- 1
Marlin/enum.h Bestand weergeven

161
   LCDVIEW_CALL_NO_REDRAW
161
   LCDVIEW_CALL_NO_REDRAW
162
 };
162
 };
163
 
163
 
164
-#if ENABLED(DUAL_X_CARRIAGE)
164
+#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
165
   enum DualXMode {
165
   enum DualXMode {
166
     DXC_FULL_CONTROL_MODE,
166
     DXC_FULL_CONTROL_MODE,
167
     DXC_AUTO_PARK_MODE,
167
     DXC_AUTO_PARK_MODE,

+ 24
- 22
Marlin/planner.cpp Bestand weergeven

131
 
131
 
132
 #if ENABLED(DISABLE_INACTIVE_EXTRUDER)
132
 #if ENABLED(DISABLE_INACTIVE_EXTRUDER)
133
   uint8_t Planner::g_uc_extruder_last_move[EXTRUDERS] = { 0 };
133
   uint8_t Planner::g_uc_extruder_last_move[EXTRUDERS] = { 0 };
134
-#endif // DISABLE_INACTIVE_EXTRUDER
134
+#endif
135
 
135
 
136
 #ifdef XY_FREQUENCY_LIMIT
136
 #ifdef XY_FREQUENCY_LIMIT
137
   // Old direction bits. Used for speed calculations
137
   // Old direction bits. Used for speed calculations
863
 
863
 
864
     #if ENABLED(DISABLE_INACTIVE_EXTRUDER) // Enable only the selected extruder
864
     #if ENABLED(DISABLE_INACTIVE_EXTRUDER) // Enable only the selected extruder
865
 
865
 
866
+      #define DISABLE_IDLE_E(N) if (!g_uc_extruder_last_move[N]) disable_E##N();
867
+
866
       for (uint8_t i = 0; i < EXTRUDERS; i++)
868
       for (uint8_t i = 0; i < EXTRUDERS; i++)
867
         if (g_uc_extruder_last_move[i] > 0) g_uc_extruder_last_move[i]--;
869
         if (g_uc_extruder_last_move[i] > 0) g_uc_extruder_last_move[i]--;
868
 
870
 
869
       switch(extruder) {
871
       switch(extruder) {
870
         case 0:
872
         case 0:
871
           enable_E0();
873
           enable_E0();
874
+          g_uc_extruder_last_move[0] = (BLOCK_BUFFER_SIZE) * 2;
872
           #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
875
           #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
873
             if (extruder_duplication_enabled) {
876
             if (extruder_duplication_enabled) {
874
               enable_E1();
877
               enable_E1();
875
               g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
878
               g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
876
             }
879
             }
877
           #endif
880
           #endif
878
-          g_uc_extruder_last_move[0] = (BLOCK_BUFFER_SIZE) * 2;
879
           #if EXTRUDERS > 1
881
           #if EXTRUDERS > 1
880
-            if (g_uc_extruder_last_move[1] == 0) disable_E1();
882
+            DISABLE_IDLE_E(1);
881
             #if EXTRUDERS > 2
883
             #if EXTRUDERS > 2
882
-              if (g_uc_extruder_last_move[2] == 0) disable_E2();
884
+              DISABLE_IDLE_E(2);
883
               #if EXTRUDERS > 3
885
               #if EXTRUDERS > 3
884
-                if (g_uc_extruder_last_move[3] == 0) disable_E3();
886
+                DISABLE_IDLE_E(3);
885
                 #if EXTRUDERS > 4
887
                 #if EXTRUDERS > 4
886
-                  if (g_uc_extruder_last_move[4] == 0) disable_E4();
888
+                  DISABLE_IDLE_E(4);
887
                 #endif // EXTRUDERS > 4
889
                 #endif // EXTRUDERS > 4
888
               #endif // EXTRUDERS > 3
890
               #endif // EXTRUDERS > 3
889
             #endif // EXTRUDERS > 2
891
             #endif // EXTRUDERS > 2
893
           case 1:
895
           case 1:
894
             enable_E1();
896
             enable_E1();
895
             g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
897
             g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
896
-            if (g_uc_extruder_last_move[0] == 0) disable_E0();
898
+            DISABLE_IDLE_E(0);
897
             #if EXTRUDERS > 2
899
             #if EXTRUDERS > 2
898
-              if (g_uc_extruder_last_move[2] == 0) disable_E2();
900
+              DISABLE_IDLE_E(2);
899
               #if EXTRUDERS > 3
901
               #if EXTRUDERS > 3
900
-                if (g_uc_extruder_last_move[3] == 0) disable_E3();
902
+                DISABLE_IDLE_E(3);
901
                 #if EXTRUDERS > 4
903
                 #if EXTRUDERS > 4
902
-                  if (g_uc_extruder_last_move[4] == 0) disable_E4();
904
+                  DISABLE_IDLE_E(4);
903
                 #endif // EXTRUDERS > 4
905
                 #endif // EXTRUDERS > 4
904
               #endif // EXTRUDERS > 3
906
               #endif // EXTRUDERS > 3
905
             #endif // EXTRUDERS > 2
907
             #endif // EXTRUDERS > 2
908
             case 2:
910
             case 2:
909
               enable_E2();
911
               enable_E2();
910
               g_uc_extruder_last_move[2] = (BLOCK_BUFFER_SIZE) * 2;
912
               g_uc_extruder_last_move[2] = (BLOCK_BUFFER_SIZE) * 2;
911
-              if (g_uc_extruder_last_move[0] == 0) disable_E0();
912
-              if (g_uc_extruder_last_move[1] == 0) disable_E1();
913
+              DISABLE_IDLE_E(0);
914
+              DISABLE_IDLE_E(1);
913
               #if EXTRUDERS > 3
915
               #if EXTRUDERS > 3
914
-                if (g_uc_extruder_last_move[3] == 0) disable_E3();
916
+                DISABLE_IDLE_E(3);
915
                 #if EXTRUDERS > 4
917
                 #if EXTRUDERS > 4
916
-                  if (g_uc_extruder_last_move[4] == 0) disable_E4();
918
+                  DISABLE_IDLE_E(4);
917
                 #endif
919
                 #endif
918
               #endif
920
               #endif
919
             break;
921
             break;
921
               case 3:
923
               case 3:
922
                 enable_E3();
924
                 enable_E3();
923
                 g_uc_extruder_last_move[3] = (BLOCK_BUFFER_SIZE) * 2;
925
                 g_uc_extruder_last_move[3] = (BLOCK_BUFFER_SIZE) * 2;
924
-                if (g_uc_extruder_last_move[0] == 0) disable_E0();
925
-                if (g_uc_extruder_last_move[1] == 0) disable_E1();
926
-                if (g_uc_extruder_last_move[2] == 0) disable_E2();
926
+                DISABLE_IDLE_E(0);
927
+                DISABLE_IDLE_E(1);
928
+                DISABLE_IDLE_E(2);
927
                 #if EXTRUDERS > 4
929
                 #if EXTRUDERS > 4
928
-                  if (g_uc_extruder_last_move[4] == 0) disable_E4();
930
+                  DISABLE_IDLE_E(4);
929
                 #endif
931
                 #endif
930
               break;
932
               break;
931
               #if EXTRUDERS > 4
933
               #if EXTRUDERS > 4
932
                 case 4:
934
                 case 4:
933
                   enable_E4();
935
                   enable_E4();
934
                   g_uc_extruder_last_move[4] = (BLOCK_BUFFER_SIZE) * 2;
936
                   g_uc_extruder_last_move[4] = (BLOCK_BUFFER_SIZE) * 2;
935
-                  if (g_uc_extruder_last_move[0] == 0) disable_E0();
936
-                  if (g_uc_extruder_last_move[1] == 0) disable_E1();
937
-                  if (g_uc_extruder_last_move[2] == 0) disable_E2();
938
-                  if (g_uc_extruder_last_move[3] == 0) disable_E3();
937
+                  DISABLE_IDLE_E(0);
938
+                  DISABLE_IDLE_E(1);
939
+                  DISABLE_IDLE_E(2);
940
+                  DISABLE_IDLE_E(3);
939
                 break;
941
                 break;
940
               #endif // EXTRUDERS > 4
942
               #endif // EXTRUDERS > 4
941
             #endif // EXTRUDERS > 3
943
             #endif // EXTRUDERS > 3

Laden…
Annuleren
Opslaan