Преглед изворни кода

Change order of inactive stepper disable/enable

This ensures that steppers that share an enable pin will only be disabled for a miniscule time.
Scott Lahteine пре 6 година
родитељ
комит
ac7e97f4fe
1 измењених фајлова са 17 додато и 17 уклоњено
  1. 17
    17
      Marlin/src/module/planner.cpp

+ 17
- 17
Marlin/src/module/planner.cpp Прегледај датотеку

@@ -939,16 +939,8 @@ void Planner::_buffer_steps(const int32_t (&target)[XYZE]
939 939
       for (uint8_t i = 0; i < EXTRUDERS; i++)
940 940
         if (g_uc_extruder_last_move[i] > 0) g_uc_extruder_last_move[i]--;
941 941
 
942
-      switch(extruder) {
942
+      switch (extruder) {
943 943
         case 0:
944
-          enable_E0();
945
-          g_uc_extruder_last_move[0] = (BLOCK_BUFFER_SIZE) * 2;
946
-          #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
947
-            if (extruder_duplication_enabled) {
948
-              enable_E1();
949
-              g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
950
-            }
951
-          #endif
952 944
           #if EXTRUDERS > 1
953 945
             DISABLE_IDLE_E(1);
954 946
             #if EXTRUDERS > 2
@@ -961,11 +953,17 @@ void Planner::_buffer_steps(const int32_t (&target)[XYZE]
961 953
               #endif // EXTRUDERS > 3
962 954
             #endif // EXTRUDERS > 2
963 955
           #endif // EXTRUDERS > 1
956
+          enable_E0();
957
+          g_uc_extruder_last_move[0] = (BLOCK_BUFFER_SIZE) * 2;
958
+          #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
959
+            if (extruder_duplication_enabled) {
960
+              enable_E1();
961
+              g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
962
+            }
963
+          #endif
964 964
         break;
965 965
         #if EXTRUDERS > 1
966 966
           case 1:
967
-            enable_E1();
968
-            g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
969 967
             DISABLE_IDLE_E(0);
970 968
             #if EXTRUDERS > 2
971 969
               DISABLE_IDLE_E(2);
@@ -976,11 +974,11 @@ void Planner::_buffer_steps(const int32_t (&target)[XYZE]
976 974
                 #endif // EXTRUDERS > 4
977 975
               #endif // EXTRUDERS > 3
978 976
             #endif // EXTRUDERS > 2
977
+            enable_E1();
978
+            g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
979 979
           break;
980 980
           #if EXTRUDERS > 2
981 981
             case 2:
982
-              enable_E2();
983
-              g_uc_extruder_last_move[2] = (BLOCK_BUFFER_SIZE) * 2;
984 982
               DISABLE_IDLE_E(0);
985 983
               DISABLE_IDLE_E(1);
986 984
               #if EXTRUDERS > 3
@@ -989,26 +987,28 @@ void Planner::_buffer_steps(const int32_t (&target)[XYZE]
989 987
                   DISABLE_IDLE_E(4);
990 988
                 #endif
991 989
               #endif
990
+              enable_E2();
991
+              g_uc_extruder_last_move[2] = (BLOCK_BUFFER_SIZE) * 2;
992 992
             break;
993 993
             #if EXTRUDERS > 3
994 994
               case 3:
995
-                enable_E3();
996
-                g_uc_extruder_last_move[3] = (BLOCK_BUFFER_SIZE) * 2;
997 995
                 DISABLE_IDLE_E(0);
998 996
                 DISABLE_IDLE_E(1);
999 997
                 DISABLE_IDLE_E(2);
1000 998
                 #if EXTRUDERS > 4
1001 999
                   DISABLE_IDLE_E(4);
1002 1000
                 #endif
1001
+                enable_E3();
1002
+                g_uc_extruder_last_move[3] = (BLOCK_BUFFER_SIZE) * 2;
1003 1003
               break;
1004 1004
               #if EXTRUDERS > 4
1005 1005
                 case 4:
1006
-                  enable_E4();
1007
-                  g_uc_extruder_last_move[4] = (BLOCK_BUFFER_SIZE) * 2;
1008 1006
                   DISABLE_IDLE_E(0);
1009 1007
                   DISABLE_IDLE_E(1);
1010 1008
                   DISABLE_IDLE_E(2);
1011 1009
                   DISABLE_IDLE_E(3);
1010
+                  enable_E4();
1011
+                  g_uc_extruder_last_move[4] = (BLOCK_BUFFER_SIZE) * 2;
1012 1012
                 break;
1013 1013
               #endif // EXTRUDERS > 4
1014 1014
             #endif // EXTRUDERS > 3

Loading…
Откажи
Сачувај