Optimize target_extruder, ignore T with mixing (#12432)

* Optimize target_extruder, ignore T with mixing
* Give G-code Tn parity with tool_change
This commit is contained in:
Scott Lahteine
2018-11-14 17:33:04 -06:00
committed by GitHub
parent 5e586a6b39
commit d2bb53702a
18 changed files with 150 additions and 138 deletions

View File

@ -33,27 +33,27 @@
* F[units/min] Set the movement feedrate
* S1 Don't move the tool in XY after change
*/
void GcodeSuite::T(const uint8_t tmp_extruder) {
void GcodeSuite::T(const uint8_t tool_index) {
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
SERIAL_ECHOPAIR(">>> T(", tmp_extruder);
SERIAL_ECHOPAIR(">>> T(", tool_index);
SERIAL_CHAR(')');
SERIAL_EOL();
DEBUG_POS("BEFORE", current_position);
}
#endif
#if HOTENDS == 1 || (ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1)
#if EXTRUDERS < 2
tool_change(tmp_extruder);
tool_change(tool_index);
#elif HOTENDS > 1
#else
tool_change(
tmp_extruder,
tool_index,
MMM_TO_MMS(parser.linearval('F')),
(tmp_extruder == active_extruder) || parser.boolval('S')
(tool_index == active_extruder) || parser.boolval('S')
);
#endif