Browse Source

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 7 years ago
parent
commit
ac7e97f4fe
1 changed files with 17 additions and 17 deletions
  1. 17
    17
      Marlin/src/module/planner.cpp

+ 17
- 17
Marlin/src/module/planner.cpp View File

939
       for (uint8_t i = 0; i < EXTRUDERS; i++)
939
       for (uint8_t i = 0; i < EXTRUDERS; i++)
940
         if (g_uc_extruder_last_move[i] > 0) g_uc_extruder_last_move[i]--;
940
         if (g_uc_extruder_last_move[i] > 0) g_uc_extruder_last_move[i]--;
941
 
941
 
942
-      switch(extruder) {
942
+      switch (extruder) {
943
         case 0:
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
           #if EXTRUDERS > 1
944
           #if EXTRUDERS > 1
953
             DISABLE_IDLE_E(1);
945
             DISABLE_IDLE_E(1);
954
             #if EXTRUDERS > 2
946
             #if EXTRUDERS > 2
961
               #endif // EXTRUDERS > 3
953
               #endif // EXTRUDERS > 3
962
             #endif // EXTRUDERS > 2
954
             #endif // EXTRUDERS > 2
963
           #endif // EXTRUDERS > 1
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
         break;
964
         break;
965
         #if EXTRUDERS > 1
965
         #if EXTRUDERS > 1
966
           case 1:
966
           case 1:
967
-            enable_E1();
968
-            g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
969
             DISABLE_IDLE_E(0);
967
             DISABLE_IDLE_E(0);
970
             #if EXTRUDERS > 2
968
             #if EXTRUDERS > 2
971
               DISABLE_IDLE_E(2);
969
               DISABLE_IDLE_E(2);
976
                 #endif // EXTRUDERS > 4
974
                 #endif // EXTRUDERS > 4
977
               #endif // EXTRUDERS > 3
975
               #endif // EXTRUDERS > 3
978
             #endif // EXTRUDERS > 2
976
             #endif // EXTRUDERS > 2
977
+            enable_E1();
978
+            g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
979
           break;
979
           break;
980
           #if EXTRUDERS > 2
980
           #if EXTRUDERS > 2
981
             case 2:
981
             case 2:
982
-              enable_E2();
983
-              g_uc_extruder_last_move[2] = (BLOCK_BUFFER_SIZE) * 2;
984
               DISABLE_IDLE_E(0);
982
               DISABLE_IDLE_E(0);
985
               DISABLE_IDLE_E(1);
983
               DISABLE_IDLE_E(1);
986
               #if EXTRUDERS > 3
984
               #if EXTRUDERS > 3
989
                   DISABLE_IDLE_E(4);
987
                   DISABLE_IDLE_E(4);
990
                 #endif
988
                 #endif
991
               #endif
989
               #endif
990
+              enable_E2();
991
+              g_uc_extruder_last_move[2] = (BLOCK_BUFFER_SIZE) * 2;
992
             break;
992
             break;
993
             #if EXTRUDERS > 3
993
             #if EXTRUDERS > 3
994
               case 3:
994
               case 3:
995
-                enable_E3();
996
-                g_uc_extruder_last_move[3] = (BLOCK_BUFFER_SIZE) * 2;
997
                 DISABLE_IDLE_E(0);
995
                 DISABLE_IDLE_E(0);
998
                 DISABLE_IDLE_E(1);
996
                 DISABLE_IDLE_E(1);
999
                 DISABLE_IDLE_E(2);
997
                 DISABLE_IDLE_E(2);
1000
                 #if EXTRUDERS > 4
998
                 #if EXTRUDERS > 4
1001
                   DISABLE_IDLE_E(4);
999
                   DISABLE_IDLE_E(4);
1002
                 #endif
1000
                 #endif
1001
+                enable_E3();
1002
+                g_uc_extruder_last_move[3] = (BLOCK_BUFFER_SIZE) * 2;
1003
               break;
1003
               break;
1004
               #if EXTRUDERS > 4
1004
               #if EXTRUDERS > 4
1005
                 case 4:
1005
                 case 4:
1006
-                  enable_E4();
1007
-                  g_uc_extruder_last_move[4] = (BLOCK_BUFFER_SIZE) * 2;
1008
                   DISABLE_IDLE_E(0);
1006
                   DISABLE_IDLE_E(0);
1009
                   DISABLE_IDLE_E(1);
1007
                   DISABLE_IDLE_E(1);
1010
                   DISABLE_IDLE_E(2);
1008
                   DISABLE_IDLE_E(2);
1011
                   DISABLE_IDLE_E(3);
1009
                   DISABLE_IDLE_E(3);
1010
+                  enable_E4();
1011
+                  g_uc_extruder_last_move[4] = (BLOCK_BUFFER_SIZE) * 2;
1012
                 break;
1012
                 break;
1013
               #endif // EXTRUDERS > 4
1013
               #endif // EXTRUDERS > 4
1014
             #endif // EXTRUDERS > 3
1014
             #endif // EXTRUDERS > 3

Loading…
Cancel
Save