|
@@ -131,7 +131,7 @@ float Planner::previous_speed[NUM_AXIS],
|
131
|
131
|
|
132
|
132
|
#if ENABLED(DISABLE_INACTIVE_EXTRUDER)
|
133
|
133
|
uint8_t Planner::g_uc_extruder_last_move[EXTRUDERS] = { 0 };
|
134
|
|
-#endif // DISABLE_INACTIVE_EXTRUDER
|
|
134
|
+#endif
|
135
|
135
|
|
136
|
136
|
#ifdef XY_FREQUENCY_LIMIT
|
137
|
137
|
// Old direction bits. Used for speed calculations
|
|
@@ -863,27 +863,29 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
|
863
|
863
|
|
864
|
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
|
868
|
for (uint8_t i = 0; i < EXTRUDERS; i++)
|
867
|
869
|
if (g_uc_extruder_last_move[i] > 0) g_uc_extruder_last_move[i]--;
|
868
|
870
|
|
869
|
871
|
switch(extruder) {
|
870
|
872
|
case 0:
|
871
|
873
|
enable_E0();
|
|
874
|
+ g_uc_extruder_last_move[0] = (BLOCK_BUFFER_SIZE) * 2;
|
872
|
875
|
#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
|
873
|
876
|
if (extruder_duplication_enabled) {
|
874
|
877
|
enable_E1();
|
875
|
878
|
g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
|
876
|
879
|
}
|
877
|
880
|
#endif
|
878
|
|
- g_uc_extruder_last_move[0] = (BLOCK_BUFFER_SIZE) * 2;
|
879
|
881
|
#if EXTRUDERS > 1
|
880
|
|
- if (g_uc_extruder_last_move[1] == 0) disable_E1();
|
|
882
|
+ DISABLE_IDLE_E(1);
|
881
|
883
|
#if EXTRUDERS > 2
|
882
|
|
- if (g_uc_extruder_last_move[2] == 0) disable_E2();
|
|
884
|
+ DISABLE_IDLE_E(2);
|
883
|
885
|
#if EXTRUDERS > 3
|
884
|
|
- if (g_uc_extruder_last_move[3] == 0) disable_E3();
|
|
886
|
+ DISABLE_IDLE_E(3);
|
885
|
887
|
#if EXTRUDERS > 4
|
886
|
|
- if (g_uc_extruder_last_move[4] == 0) disable_E4();
|
|
888
|
+ DISABLE_IDLE_E(4);
|
887
|
889
|
#endif // EXTRUDERS > 4
|
888
|
890
|
#endif // EXTRUDERS > 3
|
889
|
891
|
#endif // EXTRUDERS > 2
|
|
@@ -893,13 +895,13 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
|
893
|
895
|
case 1:
|
894
|
896
|
enable_E1();
|
895
|
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
|
899
|
#if EXTRUDERS > 2
|
898
|
|
- if (g_uc_extruder_last_move[2] == 0) disable_E2();
|
|
900
|
+ DISABLE_IDLE_E(2);
|
899
|
901
|
#if EXTRUDERS > 3
|
900
|
|
- if (g_uc_extruder_last_move[3] == 0) disable_E3();
|
|
902
|
+ DISABLE_IDLE_E(3);
|
901
|
903
|
#if EXTRUDERS > 4
|
902
|
|
- if (g_uc_extruder_last_move[4] == 0) disable_E4();
|
|
904
|
+ DISABLE_IDLE_E(4);
|
903
|
905
|
#endif // EXTRUDERS > 4
|
904
|
906
|
#endif // EXTRUDERS > 3
|
905
|
907
|
#endif // EXTRUDERS > 2
|
|
@@ -908,12 +910,12 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
|
908
|
910
|
case 2:
|
909
|
911
|
enable_E2();
|
910
|
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
|
915
|
#if EXTRUDERS > 3
|
914
|
|
- if (g_uc_extruder_last_move[3] == 0) disable_E3();
|
|
916
|
+ DISABLE_IDLE_E(3);
|
915
|
917
|
#if EXTRUDERS > 4
|
916
|
|
- if (g_uc_extruder_last_move[4] == 0) disable_E4();
|
|
918
|
+ DISABLE_IDLE_E(4);
|
917
|
919
|
#endif
|
918
|
920
|
#endif
|
919
|
921
|
break;
|
|
@@ -921,21 +923,21 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
|
921
|
923
|
case 3:
|
922
|
924
|
enable_E3();
|
923
|
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
|
929
|
#if EXTRUDERS > 4
|
928
|
|
- if (g_uc_extruder_last_move[4] == 0) disable_E4();
|
|
930
|
+ DISABLE_IDLE_E(4);
|
929
|
931
|
#endif
|
930
|
932
|
break;
|
931
|
933
|
#if EXTRUDERS > 4
|
932
|
934
|
case 4:
|
933
|
935
|
enable_E4();
|
934
|
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
|
941
|
break;
|
940
|
942
|
#endif // EXTRUDERS > 4
|
941
|
943
|
#endif // EXTRUDERS > 3
|