* 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
| 54 | * Tc Load to nozzle after filament was prepared by Tc and nozzle is already heated. |
| 55 | */ |
| 56 | void 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 |
no test coverage detected