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.

This commit is contained in:
midopple 2014-07-13 21:52:32 +02:00
parent c7273d521f
commit 17aa67e4ea

View File

@ -96,6 +96,8 @@ float autotemp_factor=0.1;
bool autotemp_enabled=false; bool autotemp_enabled=false;
#endif #endif
unsigned char g_uc_extruder_last_move[3] = {0,0,0};
//=========================================================================== //===========================================================================
//=================semi-private variables, used in inline functions ===== //=================semi-private variables, used in inline functions =====
//=========================================================================== //===========================================================================
@ -662,11 +664,34 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi
{ {
if (DISABLE_INACTIVE_EXTRUDER) //enable only selected extruder if (DISABLE_INACTIVE_EXTRUDER) //enable only selected extruder
{ {
if(g_uc_extruder_last_move[0] > 0) g_uc_extruder_last_move[0]--;
if(g_uc_extruder_last_move[1] > 0) g_uc_extruder_last_move[1]--;
if(g_uc_extruder_last_move[2] > 0) g_uc_extruder_last_move[2]--;
switch(extruder) switch(extruder)
{ {
case 0: enable_e0(); disable_e1(); disable_e2(); break; case 0:
case 1: disable_e0(); enable_e1(); disable_e2(); break; enable_e0();
case 2: disable_e0(); disable_e1(); enable_e2(); break; g_uc_extruder_last_move[0] = BLOCK_BUFFER_SIZE*2;
if(g_uc_extruder_last_move[1] == 0) disable_e1();
if(g_uc_extruder_last_move[2] == 0) disable_e2();
break;
case 1:
enable_e1();
g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE*2;
if(g_uc_extruder_last_move[0] == 0) disable_e0();
if(g_uc_extruder_last_move[2] == 0) disable_e2();
break;
case 2:
enable_e2();
g_uc_extruder_last_move[2] = BLOCK_BUFFER_SIZE*2;
if(g_uc_extruder_last_move[0] == 0) disable_e0();
if(g_uc_extruder_last_move[1] == 0) disable_e1();
break;
} }
} }
else //enable all else //enable all