Browse Source

If the option DISABLE_INACTIVE_EXTRUDER ist active the extruder switch to early to inactive because there are some moves in the buffer. So the planner wait 32 moves to disable the unused extruder.

midopple 11 years ago
parent
commit
17aa67e4ea
1 changed files with 28 additions and 3 deletions
  1. 28
    3
      Marlin/planner.cpp

+ 28
- 3
Marlin/planner.cpp View File

96
 bool autotemp_enabled=false;
96
 bool autotemp_enabled=false;
97
 #endif
97
 #endif
98
 
98
 
99
+unsigned char g_uc_extruder_last_move[3] = {0,0,0};
100
+
99
 //===========================================================================
101
 //===========================================================================
100
 //=================semi-private variables, used in inline  functions    =====
102
 //=================semi-private variables, used in inline  functions    =====
101
 //===========================================================================
103
 //===========================================================================
662
   {
664
   {
663
     if (DISABLE_INACTIVE_EXTRUDER) //enable only selected extruder
665
     if (DISABLE_INACTIVE_EXTRUDER) //enable only selected extruder
664
     {
666
     {
667
+
668
+      if(g_uc_extruder_last_move[0] > 0) g_uc_extruder_last_move[0]--;
669
+      if(g_uc_extruder_last_move[1] > 0) g_uc_extruder_last_move[1]--;
670
+      if(g_uc_extruder_last_move[2] > 0) g_uc_extruder_last_move[2]--;
671
+      
665
       switch(extruder)
672
       switch(extruder)
666
       {
673
       {
667
-        case 0: enable_e0(); disable_e1(); disable_e2(); break;
668
-        case 1: disable_e0(); enable_e1(); disable_e2(); break;
669
-        case 2: disable_e0(); disable_e1(); enable_e2(); break;
674
+        case 0: 
675
+          enable_e0(); 
676
+          g_uc_extruder_last_move[0] = BLOCK_BUFFER_SIZE*2;
677
+          
678
+          if(g_uc_extruder_last_move[1] == 0) disable_e1(); 
679
+          if(g_uc_extruder_last_move[2] == 0) disable_e2(); 
680
+        break;
681
+        case 1:
682
+          enable_e1(); 
683
+          g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE*2;
684
+          
685
+          if(g_uc_extruder_last_move[0] == 0) disable_e0(); 
686
+          if(g_uc_extruder_last_move[2] == 0) disable_e2(); 
687
+        break;
688
+        case 2:
689
+          enable_e2(); 
690
+          g_uc_extruder_last_move[2] = BLOCK_BUFFER_SIZE*2;
691
+          
692
+          if(g_uc_extruder_last_move[0] == 0) disable_e0(); 
693
+          if(g_uc_extruder_last_move[1] == 0) disable_e1(); 
694
+        break;        
670
       }
695
       }
671
     }
696
     }
672
     else //enable all
697
     else //enable all

Loading…
Cancel
Save