MCPcopy Create free account
hub / github.com/MarlinFirmware/Marlin / T

Method T

Marlin/src/gcode/control/T.cpp:56–90  ·  view source on GitHub ↗

* T0-T : Switch tool, usually switching extruders * * Parameters: * F Set the movement feedrate * S1 Don't move the tool in XY after change * * For PRUSA_MMU2(S) and EXTENDABLE_EMU_MMU2(S) * T G-code to extrude at least 38.10 mm at feedrate 19.02 mm/s must follow immediately to load to extruder wheels. * T? G-code to extrude shouldn't have to f

Source from the content-addressed store, hash-verified

54 * Tc Load to nozzle after filament was prepared by Tc and nozzle is already heated.
55 */
56void GcodeSuite::T(const int8_t tool_index) {
57
58 #if HAS_MULTI_EXTRUDER
59 // For 'T' with no parameter report the current tool.
60 if (parser.string_arg && *parser.string_arg == '*') {
61 SERIAL_ECHOLNPGM(STR_ACTIVE_EXTRUDER, active_extruder);
62 return;
63 }
64 #endif
65
66 DEBUG_SECTION(log_T, "T", DEBUGGING(LEVELING));
67 if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("...(", tool_index, ")");
68
69 // Count this command as movement / activity
70 reset_stepper_timeout();
71
72 #if HAS_PRUSA_MMU3
73 if (parser.has_string()) {
74 mmu3.tool_change(parser.string_arg[0], uint8_t(tool_index)); // Special commands T?/Tx/Tc
75 return;
76 }
77 #elif HAS_PRUSA_MMU2
78 if (parser.string_arg) {
79 mmu2.tool_change(parser.string_arg); // Special commands T?/Tx/Tc
80 return;
81 }
82 #endif
83
84 tool_change(tool_index
85 #if HAS_MULTI_EXTRUDER
86 , parser.boolval('S')
87 || TERN(PARKING_EXTRUDER, false, tool_index == active_extruder) // For PARKING_EXTRUDER motion is decided in tool_change()
88 #endif
89 );
90}
91
92#endif // HAS_TOOLCHANGE

Callers 5

tool_changeFunction · 0.45
M600Method · 0.45
M701Method · 0.45
M702Method · 0.45
_lcd_mixer_select_vtoolFunction · 0.45

Calls 4

tool_changeFunction · 0.85
has_stringMethod · 0.80
boolvalMethod · 0.80
tool_changeMethod · 0.45

Tested by

no test coverage detected