1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-27 13:56:24 +00:00

Change order of inactive stepper disable/enable

This ensures that steppers that share an enable pin will only be disabled for a miniscule time.
This commit is contained in:
Scott Lahteine 2018-03-30 15:10:03 -05:00
parent f5c980f9cf
commit 0eb1830d85

View File

@ -928,16 +928,8 @@ void Planner::_buffer_steps(const int32_t (&target)[XYZE]
for (uint8_t i = 0; i < EXTRUDERS; i++)
if (g_uc_extruder_last_move[i] > 0) g_uc_extruder_last_move[i]--;
switch(extruder) {
switch (extruder) {
case 0:
enable_E0();
g_uc_extruder_last_move[0] = (BLOCK_BUFFER_SIZE) * 2;
#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
if (extruder_duplication_enabled) {
enable_E1();
g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
}
#endif
#if EXTRUDERS > 1
DISABLE_IDLE_E(1);
#if EXTRUDERS > 2
@ -950,11 +942,17 @@ void Planner::_buffer_steps(const int32_t (&target)[XYZE]
#endif // EXTRUDERS > 3
#endif // EXTRUDERS > 2
#endif // EXTRUDERS > 1
enable_E0();
g_uc_extruder_last_move[0] = (BLOCK_BUFFER_SIZE) * 2;
#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
if (extruder_duplication_enabled) {
enable_E1();
g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
}
#endif
break;
#if EXTRUDERS > 1
case 1:
enable_E1();
g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
DISABLE_IDLE_E(0);
#if EXTRUDERS > 2
DISABLE_IDLE_E(2);
@ -965,11 +963,11 @@ void Planner::_buffer_steps(const int32_t (&target)[XYZE]
#endif // EXTRUDERS > 4
#endif // EXTRUDERS > 3
#endif // EXTRUDERS > 2
enable_E1();
g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
break;
#if EXTRUDERS > 2
case 2:
enable_E2();
g_uc_extruder_last_move[2] = (BLOCK_BUFFER_SIZE) * 2;
DISABLE_IDLE_E(0);
DISABLE_IDLE_E(1);
#if EXTRUDERS > 3
@ -978,26 +976,28 @@ void Planner::_buffer_steps(const int32_t (&target)[XYZE]
DISABLE_IDLE_E(4);
#endif
#endif
enable_E2();
g_uc_extruder_last_move[2] = (BLOCK_BUFFER_SIZE) * 2;
break;
#if EXTRUDERS > 3
case 3:
enable_E3();
g_uc_extruder_last_move[3] = (BLOCK_BUFFER_SIZE) * 2;
DISABLE_IDLE_E(0);
DISABLE_IDLE_E(1);
DISABLE_IDLE_E(2);
#if EXTRUDERS > 4
DISABLE_IDLE_E(4);
#endif
enable_E3();
g_uc_extruder_last_move[3] = (BLOCK_BUFFER_SIZE) * 2;
break;
#if EXTRUDERS > 4
case 4:
enable_E4();
g_uc_extruder_last_move[4] = (BLOCK_BUFFER_SIZE) * 2;
DISABLE_IDLE_E(0);
DISABLE_IDLE_E(1);
DISABLE_IDLE_E(2);
DISABLE_IDLE_E(3);
enable_E4();
g_uc_extruder_last_move[4] = (BLOCK_BUFFER_SIZE) * 2;
break;
#endif // EXTRUDERS > 4
#endif // EXTRUDERS > 3